Skip to content

Instantly share code, notes, and snippets.

View tyrelsouza's full-sized avatar

Tyrel Souza tyrelsouza

View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
import argparse
import json
import os
import pylast
from slacker import Slacker
from sys import platform as _platform
import time
LASTFM_USER= os.environ['LASTFM_USER']
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'"