Skip to content

Instantly share code, notes, and snippets.

View alisalmabadi's full-sized avatar
🎯
Focusing

Ali Salmabadi alisalmabadi

🎯
Focusing
View GitHub Profile
@hasanparasteh
hasanparasteh / bank-identify.js
Created January 24, 2022 22:26
A complete list of Iran ibans and cards number to identify bank
// List of all cards
const cards = [
{
62198619: {
persian: 'بلو',
english: 'blue',
},
},
{
603799: {
@kodie
kodie / updateModified.js
Last active April 15, 2024 07:02
A JavaScript function for Google Sheets that updates a specific cell with the current date/time when cell(s) are updated.
function getColumnNumberByName(name, sheet) {
if (!sheet) {
sheet = SpreadsheetApp.getActiveSheet()
}
var headers = sheet.getDataRange().offset(0, 0, 1).getValues()[0]
var column = false
for (var i = 0; i < headers.length; i++) {
if (headers[i].trim() === name) {
@mahbodsh
mahbodsh / ProductResourceCollection.php
Last active July 13, 2023 03:42
Pagination helper in laravel resource
<?php
namespace App\Http\Resources;
use App\Helpers\ResourcePaginationHelper;
use Illuminate\Http\Resources\Json\ResourceCollection;
class ProductsResourceCollection extends ResourceCollection
{
/**
@mtherien
mtherien / DbContextKeyExtensions.cs
Created May 7, 2020 19:56
DbContext Extension to get primary keys of an entity
// Source: https://stackoverflow.com/questions/30688909/how-to-get-primary-key-value-with-entity-framework-core
public static class DbContextKeyExtensions
{
private static readonly ConcurrentDictionary<Type, IProperty[]> KeyPropertiesByEntityType = new ConcurrentDictionary<Type, IProperty[]>();
public static string KeyValuesAsString(this EntityEntry entry)
{
if (entry == null)
{
@mortezashojaei
mortezashojaei / OrdersComponent.tsx
Last active March 19, 2025 12:42
Using laravel-echo in reactjs
import React, { FC } from 'react';
import { useSocket } from '@myapp/hooks';
import {Order} from '@myapp/models';
export const OrdersComponent: FC = () => {
const [orders,setOrders] = useState<Order[]>();
function addNewOrder(neworder:Order) {
@bradtraversy
bradtraversy / docker_wordpress.md
Last active January 4, 2026 11:49
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@alisalmabadi
alisalmabadi / get_instagram_users_data.php
Last active January 26, 2019 08:26
by this php function you can get most of the important users data without Instagram api
function get_instagram_users_data($pageUrl) {
$url = $pageUrl;
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
@MoienTajik
MoienTajik / iranian-phone-numbers-regex.md
Last active November 29, 2025 07:27
Regex For Iranian Mobile Phone Numbers

Regex For Iranian Phone Numbers

This regex supports all kinds of Iranian mobile phone numbers :

^(\+98|0)?9\d{9}$


Regex Visualized

@amirasaran
amirasaran / Arabic character to Persian (Farsi) - PHP
Last active April 18, 2025 07:26
convert Arabic character to Persian (Farsi) - PHP
<?php
public static function arabicToPersian($string)
{
$characters = [
'ك' => 'ک',
'دِ' => 'د',
'بِ' => 'ب',
'زِ' => 'ز',
'ذِ' => 'ذ',
'شِ' => 'ش',
@erfansahaf
erfansahaf / SDate.php
Created December 16, 2015 22:43
a php class for work with Gregorian and Jalali dates
<?php
/* If you use Codeigniter framework, uncomment following ↓ line */
//defined('BASEPATH') OR exit('No direct script access allowed');
/*
* @name Shamsi Date (SDate)
* @author Erfan Sahafnejad <Erfan.Sahaf@gmail.com/>
* @copyright 2015 P30Skill Development Team (http://P30Skill.ir)
* @version 1.0
* @link www.P30Skill.ir