Skip to content

Instantly share code, notes, and snippets.

View ehsansabet's full-sized avatar

Ehsan Sabet ehsansabet

View GitHub Profile
@ehsansabet
ehsansabet / README.md
Last active February 26, 2025 23:30
Add Event to Google Calendar
@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
@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 / xinput
Created December 31, 2020 07:48
Enable touchpad click
// Get input list
$ xinput
// Choose tochpad input name or id (id maybe change after reboot)
// For example: ELAN1300:00 04F3:3057 Touchpad id=14
$ xinput list-props "ELAN1300:00 04F3:3057 Touchpad"
// Enable tapping
$ xinput set-prop "ELAN1300:00 04F3:3057 Touchpad" "libinput Tapping Enabled" 1
@ehsansabet
ehsansabet / Syncing-fork.md
Created October 4, 2020 09:29
Syncing a fork

#Syncing a fork

##Configuring a remote for a fork

$ git remote -v
> origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)

$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
/* play video twice as fast */
document.querySelector('video').defaultPlaybackRate = 2.0;
document.querySelector('video').play();
/* now play three times as fast just for the heck of it */
document.querySelector('video').playbackRate = 3.0;
@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 / 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 / check-shaparak-phishing.user.js
Created November 17, 2018 13:54
Check Shaparak Phishing
// ==UserScript==
// @name Check Shaparak Phishing
// @author Ehsan Sabet
// @include https://*.shaparak.ir/*
// @run-at document-end
// @version 0.1
// ==/UserScript==
(function() {
var valid = '<div style="position:fixed;top:0;left:0;width:100%;background-color: rgba(0,255,0,0.5);z-index: 99999;text-align: center;"><h3 style="color: green;z-index: 999999;text-align: center;font-size:13px;">درگاه پرداخت قانونی است.</h3></div>';