Skip to content

Instantly share code, notes, and snippets.

View gelendir's full-sized avatar

Gregory Eric Sanderson gelendir

View GitHub Profile
@gelendir
gelendir / notetime.py
Created April 10, 2015 19:33
Show time under musical notation form
from __future__ import unicode_literals
from datetime import datetime
WHOLE_NOTE = "\U0001D15D"
HALF_NOTE = "\U0001D15E"
QUARTER_NOTE = "\U0001D15F"
EIGHTH_NOTE = "\U0001D160"
WHOLE_REST = "\U0001D13B"
HALF_REST = "\U0001D13C"
@gelendir
gelendir / tdd_notes.md
Last active August 29, 2015 14:00
tdd

commands

beginner

  • cat
  • echo
  • date
  • sleep
@gelendir
gelendir / sh_examples.py
Created February 4, 2014 21:21
Python sh examples
from sh import ifconfig, git, cd, touch, wc, find, ps, tail, ls, mkdir
def iface_info(iface='wlan0'):
print(ifconfig(iface))
def create_git_repo(path):
mkdir(path, p=True)
cd(path)
@gelendir
gelendir / ninja_name.py
Created October 31, 2013 03:02
Convert to samurai name
letters = {
'a': 'ka',
'b': 'zu',
'c': 'mi',
'd': 'te',
'e': 'ku',
'f': 'lu',
'g': 'ji',
'h': 'ri',
'i': 'ki',
@gelendir
gelendir / slides.md
Last active December 23, 2015 16:39

title: Fabric name: inverse layout: true class: center, middle, inverse

#Fabric

Lord Junior 6th Gregory Eric Sanderson Turcot Temlett MacDonnell of Glengary Forbes of Linden

CONFIGFILE_PATH = "~/.tiktok.conf"
config = None
def get_config():
global config
if not config:
config = loadconfig( configfile )
return config
#!/usr/bin/env python2
import urllib
import json
URL="HTTPS://mtgox.com/api/1/BTCUSD/ticker"
print json.loads(urllib.urlopen(URL).read())['return']['last_local']['value']
<?php
$BASE_URL = "http://131.137.250.85/cgi-bin/qweb.dll";
$SCRIPT_NAME = basename(__FILE__);
function send_request($url, $body=null) {
$query = parse_url($url);
@gelendir
gelendir / imgurdl.py
Created October 23, 2011 01:08
imgur album downloader
from html.parser import HTMLParser
from urllib import request
import os.path
import re
import json
import sys
class ImgListScraper( HTMLParser ):
@gelendir
gelendir / jobsdead.py
Created September 11, 2011 22:12
Is steve jobs dead ?
#!/usr/bin/env python2
import urllib
import smtplib
import time
from HTMLParser import HTMLParser
from email.mime.text import MIMEText
SERVER = "smtp.gmail.com"
PORT = 587