Skip to content

Instantly share code, notes, and snippets.

View kennydude's full-sized avatar

Joe Simpson kennydude

View GitHub Profile
@kennydude
kennydude / post.md
Created September 16, 2014 21:21
How PowerLine Works

How Does The Powerline thing work?

I recently was enlightened to Powerlines, the cool terminal thing that looks really cool.

But, me being me I wanted to know how this thing worked, but nobody has wrote anything and I've found out.

Basically the "patched fonts" just add some symbols like arrows and git icons so they render in your terminal properly.

By Powerline, I mean this thing:

@kennydude
kennydude / loves.py
Created March 7, 2010 15:21
It's that love game that loads of girls love to do. I recreated how it did that completly in Python!
import time
print "LOVE"
print "begin typing:"
_lover = raw_input()
lover = _lover.upper()
print "loves"
_loved = raw_input()
loved = _loved.upper()
print "Contacting cupids... please hold..."
@kennydude
kennydude / fugue-generate-html.py
Created May 11, 2010 18:26
Generates a html file with all the fugue shadowless icons in it!
#!/usr/bin/python
'''
Tools for generating html for fugue icons
THEY MUST BE IN DIR fugue-icons FROM THIS SCRIPT!
Make sure you can write to icons.html
Your web browser may crash while first rendering
'''
print "Generating html..."
import os
@kennydude
kennydude / SimpleDjangoTags.py
Created May 23, 2010 18:04
Extremely Simple Django Template Tags
'''
Extremely Simple Django Template Tags!
'''
from django.template import Library, Node, TemplateSyntaxError, resolve_variable
from django.utils.translation import ugettext as _
register = Library()
class GenericTNode(Node):
def __init__(self, parts):
@kennydude
kennydude / Response Hanlder.java
Created April 4, 2011 18:53
Response Handler
if(response.getStatusLine().getStatusCode() == 200){
}
@kennydude
kennydude / udp-messaging.py
Created April 8, 2011 10:11
Simple UDP messaging tool in python to send cross-network messages to all other users. (Useful for people in multiple rooms at home!)
#!/usr/bin/python
# UDP messaging
try:
import tkMessageBox
def displayMessage(message):
tkMessageBox.showinfo("Message", message)
except ImportError:
pass
def geti(array, item):
'''
FailProxy
created by @kennydude
You need a failproxy.txt in the same directory as this script.
Then launch, configure your browser to connect here.
Now put something in failproxy.txt, save and reload.
Whoops! You just cut off access, remove contents of that file to restore access

This Gist Fixes Oggs

What we do is check using "ogginfo" which you need installed to your system and if that tells us your ogg file is dodgy it'll fix it.

It works for Vorbis files as Banshee had trouble playing some badly encoded ones. It seems to retain all tags too!

You may need to modify the location of the music for it to work depending on your setup!

@kennydude
kennydude / AndroidExport.py
Created July 19, 2011 17:39
Photoshop Exporter for Android Assets!
import win32com.client
psApp = win32com.client.Dispatch("Photoshop.Application")
print "Please make sure you have the current document open and saved in the base of your project as we're going to save it by dpi NOW."
print "You also need the document in 320dpi for this to work properly!"
try:
var = input("Press enter")
except:
pass
import os
@kennydude
kennydude / fixtags.py
Created August 19, 2011 13:38
Fix tags
'''
Problem tags?
For now it only fixes ogg files, sorry!
Just run it where it's just under your music folder or modify the code as needed
'''
print "TAG FIXER!"
import glob, subprocess, os, mutagen
from mutagen.easyid3 import EasyID3