Skip to content

Instantly share code, notes, and snippets.

View qa1's full-sized avatar
🎯
Focusing

qa1

🎯
Focusing
View GitHub Profile
@prologic
prologic / LearnGoIn5mins.md
Last active June 20, 2024 04:04
Learn Go in ~5mins
@ehsansabet
ehsansabet / switch to php any version
Last active September 21, 2020 11:06 — forked from qa1/switch to php 7.1
Switch PHP version
#!/bin/bash
phpversion=$1
[ -z "$phpversion" ] && { echo "Please input php version. for example: 7.0"; exit 1;}
phpextdir=$(php -r "echo ini_get('extension_dir');")
[ ! -f "/usr/bin/php$phpversion" ] && { echo "PHP version $phpversion not found! /usr/bin/php$phpversion"; exit 1;}
sudo update-alternatives --set php /usr/bin/php$phpversion &&
sudo update-alternatives --set phar /usr/bin/phar$phpversion &&
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$phpversion &&
خورشت کلم پلو کوکو دم‌پخت ماهی‌پلو قلیه ماهی آش کوفته خورشت کرفس دلمه سوپ آش غوره آش ماست آش شلغم ترش‌تره
برگ چغندر TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE
ترخون FALSE TRUE FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
تره TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE
جعفری TRUE FALSE TRUE FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
ریحان FALSE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE
سیر FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
شاهی FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
شلغم FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE
شملیز TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
@meysampg
meysampg / jalaali_utils.go
Last active May 15, 2020 18:47
Calculate some useful infornation on Jalali Calendar
// algorithms from php version of https://jdf.scr.ir/download/
package cal
import (
"log"
"strconv"
"strings"
"time"
"github.com/jalaali/go-jalaali"
@ssbostan
ssbostan / backup.sh
Created May 3, 2020 15:52
Create a backup and Delete old backups
#!/bin/bash
tar -zcf /backups/backup-$(date +%Y%m%d).tar.gz --absolute-names /data
rm -f /backups/backup-$(date -d 'now - 7 days' +%Y%m%d).tar.gz
// delete all origin branch that deleted from origin and stay in your local
git fetch -p
// chekout to main brach to prevent delete it from local
git checkout master
// delete all local branch
git branch | xargs git branch -d
// delete all origin branch that don't deleted from origin and stay in your local
git branch | xargs git branch -D
// now you have master branch in local
@bardiarastin
bardiarastin / useApi.ts
Last active September 10, 2020 03:43
simple React custom hook for api access
import { useState, useEffect } from "react";
import { AxiosPromise } from "axios";
interface IState<T = any> {
isLoading: boolean;
isError: boolean;
data: T;
}
const initialState: IState = {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.