Skip to content

Instantly share code, notes, and snippets.

function GitHub()
{
if [ ! -d .git ] ;
then echo "ERROR: This isnt a git directory" && return false;
fi
git_url=`git config --get remote.origin.url`
if [[ $git_url == https://github* ]];
then
url=${git_url%.git}
else
@tyrelsouza
tyrelsouza / README
Last active January 17, 2017 22:01
Take shot and timestamp and SIGUSR rpi
1. Install imagmagick, nginx, and raspistill.
2. Set a call to take_shot.sh in cron.
3. Drop html to be served by nginx.
@tyrelsouza
tyrelsouza / oh_fuck.sh
Created December 15, 2016 22:10
Undo a commit FORCEFULLY.
#!/bin/bash
git tag temp$RANDOM
git reset --hard HEAD^
git push --force
echo "There. I fixed your stupid mistake Tyrel"
@tyrelsouza
tyrelsouza / fix_shadowrun_id3.py
Created March 17, 2016 13:14
Fix ID3 Shadowrun Chronicles from Humble Bundle
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from mutagen.id3 import ID3, TALB, TPE1, TDRC, TCOM, TIT2
fnames = (u"01 Alexander Guski - Digital Destiny.mp3",
u"02 Andrew Carroll - Shadowrun Chronicles.mp3",
u"03 Akpomuje Garreis - Arcology is reopening.mp3",
u"04 Carlos Martin - Epic.mp3",
u"05 Carlos Martin - Drums of War.mp3",
u"06 GÇry Montet - The Awakening of the Sixth World.mp3",
@tyrelsouza
tyrelsouza / github_hide_comment_close.user.js
Last active March 11, 2016 16:26
Hide Github Comment and Close Button - Grease Monkey
// ==UserScript==
// @name Tyrel Github
// @namespace https://github.com/tyrelsouza
// @description Hide elements from github
// @include https://github.com/*
// @version 1
// @grant none
// ==/UserScript==
@tyrelsouza
tyrelsouza / download_m3u.py
Created October 27, 2015 03:39
Download an M3U listing
__author__ = 'tsouza'
import urllib2
def download(url, base):
file_name = url.split('/')[-1]
u = urllib2.urlopen(url)
f = open(base + file_name, 'wb')
meta = u.info()
[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*'
@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 / 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
#!/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