Skip to content

Instantly share code, notes, and snippets.

[alias]
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
logtree= "log --graph --oneline --decorate --all"
la = "!git config -l | grep alias | cut -c 7-"
recent = "!git for-each-ref --format=\"%(committerdate:relative) | %(refname)\" --sort=-committerdate refs/heads | sed '/master/d' | head -n 10"
tabsescape = "!git diff --color | sed 's/\\t/\\\\t/g'"
tabs = "!git diff --color | sed 's/\\t/⌑/g'"
v=describe --tags --match 'v*'

Developer Cheat Sheets

This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everyday and this Gist is the first bookmark on my list for quick and easy access.

I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer.

Verifying I am +tyrel on my passcard. https://onename.com/tyrel
@tyrelsouza
tyrelsouza / import_keys.py
Last active August 29, 2015 14:21
Import Keybase Keys you are Tracking into GnuPG
import gnupg
import urllib
from subprocess import Popen, PIPE
import os
from pprint import pprint
def get_names():
p = Popen(['keybase', 'list-tracking'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
@tyrelsouza
tyrelsouza / import_keys.sh
Created May 12, 2015 20:05
Get GPG keys from Keybase
#!/bin/bash
keybase list-tracking | while read -r line ; do
if [ -n "$line" ]; then
curl -s https://keybase.io/$line/key.asc | gpg --with-fingerprint | sed -n 's/.*=//p' | awk 'NF>1{print $(NF-3)$(NF-2)$(NF-1)$(NF) }' | while read -r key; do
echo "Trying $line's key: $key"
gpg --recv-key $key
echo
done
fi
done
@tyrelsouza
tyrelsouza / clipboard-gitbranch.sh
Last active August 29, 2015 14:21
Copy git branch to your clipboard (needs xsel or pbcopy installed)
function cpbr {
if branch=$(git symbolic-ref --short -q HEAD)
then
if command -v pbcopy 2>/dev/null; then
printf "$branch" | pbcopy
echo "$branch copied to your clipboard using pbcopy"
elif command -v xsel 2>/dev/null; then
printf "$branch" | xsel --clipboard
echo "$branch copied to your clipboard using xsel"
else
#!/usr/bin/env python
''' Get a list of out-of-date packages from a pip requirements.txt file. '''
import itertools
import json
import requests
import sys
import yaml
@tyrelsouza
tyrelsouza / kickle_complete.lua
Created August 8, 2015 20:53
Kickle Cubicle detect when level complete FCEUX LUA script
emu.speedmode("normal") -- Set the speed of the emulator
-- It's 00B1 on the rom I have, might differ/
local MEM_ADDR = tonumber("00B1", 16)
local completed_level = false;
while true do
-- Execute instructions for FCEUX
local mem_val = memory.readbyte(MEM_ADDR)
if (mem_val == 1) then
@tyrelsouza
tyrelsouza / .gitconfig
Created August 18, 2015 19:38
Custom Git config commands
[alias]
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
logtree= "log --graph --oneline --decorate --all"
la = "!git config -l | grep alias | cut -c 7-"
recent = "!git for-each-ref --format=\"%(committerdate:relative) | %(refname)\" --sort=-committerdate refs/heads | sed '/master/d' | head -n 10"
tabsescape = "!git diff --color | sed 's/\\t/\\\\t/g'"
tabs = "!git diff --color | sed 's/\\t/⌑/g'"
@tyrelsouza
tyrelsouza / plugin.py
Created April 27, 2012 03:59 — forked from anonymous/plugin.py
Da bikebot code
import bcrypt
import redis
import re, os
import urllib2
import json
import time
import datetime
import supybot.conf as conf
import supybot.utils as utils
from supybot.commands import *