Skip to content

Instantly share code, notes, and snippets.

View cdp1337's full-sized avatar

Charlie Powell cdp1337

View GitHub Profile
### Keybase proof
I hereby claim:
* I am cdp1337 on github.
* I am cdp1337 (https://keybase.io/cdp1337) on keybase.
* I have a public key whose fingerprint is 8722 48CA 2F4D 312C 59B2 7A56 DB0A D0EB B2BE DCCB
To claim this, I am signing this object:
@cdp1337
cdp1337 / omfg-browser-spin.js
Last active December 14, 2015 15:18
Browser spin, suitable for use in bookmarks ;)
// Minified, copy this to your bookmark!
javascript:(function(){s=document.createElement("script");s.src="http://code.jquery.com/jquery-1.9.1.min.js";document.body.appendChild(s);var e=prompt("Spin what?"),t=jQuery('<div style="position:absolute;width:100%;height:100%;top:0;left:0;z-index:9999;opacity:0.5;"/>');jQuery("body").append(t);setInterval(function(){t.css("background","rgb("+Math.floor(Math.random()*256)+","+Math.floor(Math.random()*256)+","+Math.floor(Math.random()*256)+")");jQuery(e).each(function(){var e=jQuery(this),t=e.attr("deg")!=null?parseInt(e.attr("deg")):Math.floor(Math.random()*720),n=e.attr("huechanging")!=null?e.attr("huechanging"):Math.floor(Math.random()*2),r=[Math.floor(Math.random()*256),Math.floor(Math.random()*256),Math.floor(Math.random()*256)],i;t+=7;r[n]+=5;if(t>720)t=0;i="rgb("+r[0]+","+r[1]+","+r[2]+")";e.attr("deg",t);if(t>360)t=360-t;e.css("transform","rotate("+t+"deg)").css("color",i).css("border-color",i)})},50)})();
// Unminified
javascript:(function(){
s=document.c
@cdp1337
cdp1337 / generate_playlist.sh
Created September 7, 2012 03:14
Just a quick script to generate a playlist of music in the current directory.
#!/bin/bash
#
# Version 0.1
# Author Charlie Powell
#
# Name the playlist whatever this directory is called.
PLAYLIST="$(echo $(basename \\"`pwd`\\") | sed 's#\\##')"
# Create the file header, m3u was picked because it's dead simple.