Skip to content

Instantly share code, notes, and snippets.

View ehsansabet's full-sized avatar

Ehsan Sabet ehsansabet

View GitHub Profile
@ehsansabet
ehsansabet / package.json
Created May 1, 2020 14:54 — forked from adamreisnz/package.json
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@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 &&
@ehsansabet
ehsansabet / chunk.go
Created January 24, 2022 09:09 — forked from mustafaturan/chunk.go
Go / Chunk Slice
# https://play.golang.org/p/JxqibtHkuO-
func chunkBy(items []string, chunkSize int) (chunks [][]string) {
for chunkSize < len(items) {
items, chunks = items[chunkSize:], append(chunks, items[0:chunkSize:chunkSize])
}
return append(chunks, items)
}
@ehsansabet
ehsansabet / AdbCommands
Created August 13, 2023 10:03 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader