Instantly share code, notes, and snippets.

View gist:d7e2e64696a19d8bddd272bb9f611933
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
View README.md
title tags authors
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
git
github
gitlab
bitbucket
MoOx
View proxy-switcher.sh
# using:
# for set proxy:
# $ setproxy 127.0.0.1 8118
# for unset:
# $ unsetproxy
function setproxy() {
export {http,https,ftp,HTTP,HTTPS}_proxy=http://$1:$2
export no_proxy="localhost,127.0.0.1,master.cafecluster"
echo "Proxy variable(http,https,ftp) set to $1:$2"
View breachcompilation.txt
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size:
View IDM Cleaner.bat
IDM Cleaner.bat
:: IDM Registry Cleaner
:: Completely cleans registry of all IDM fake serial leftovers
@ECHO OFF
@TITLE IDM Registry Cleaner
@COLOR 0E
@ECHO :: IDM Registry Cleaner
@ECHO :: Compeletely cleans registry of all IDM fake serial leftovers
@ECHO.
View labels_1024.tsv
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file
7
2
1
0
4
1
4
9
5
9
View text2speech.py
import win32com.client as wincl
import random
from time import sleep
speak = wincl.Dispatch("SAPI.SpVoice")
problems=[13,30,4,14,40,5,15,50,6,16,60,70,17,'seventh','sixth','fifth','fourth']
while True:
rnd=str(random.choice(problems))
speak.Speak(rnd)
View open.py
import webbrowser
mom="http://dictionary.cambridge.org/dictionary/english/"
fs="line.txt"
f=open(fs, 'r+')
lines = tuple(f)
f.close()
for l in lines:
l=l.replace('\n','').lower()
if len(l)>1:
webbrowser.open(mom+l)
View NearestColor.py
# import Image
# f = raw_input('Image:\n')
# im = Image.open(f)
# rgb_im = im.convert('RGB')
# r, g, b = rgb_im.getpixel((x, y))
# def distance(c1, c2):
# (r1,g1,b1) = c1
# (r2,g2,b2) = c2
View gradients_list.json
[
{
"name": "Purple Love",
"colors": ["#cc2b5e", "#753a88"]
},
{
"name": "Sexy Blue",
"colors": ["#2193b0", "#6dd5ed"]
},
{