Skip to content

Instantly share code, notes, and snippets.

@tkh44
tkh44 / update_comics.py
Created June 18, 2012 21:57
Get latest comics from reddit.com/r/fffffffuuuuuuuuuuu
__author__ = 'kye.hohenberger'
from urllib2 import urlopen
from django.utils import simplejson as json
import datetime
from ragedigest.models import Comic, Queue
import reddit
import sys
@tkh44
tkh44 / usersettings.js
Created June 28, 2012 22:02
user settings
{
"sublimelinter_disable": ["css"],
"sublimelinter_syntax_map":
{
"Javascript YUI": "javascript"
}
}
@tkh44
tkh44 / setactivepage.js
Created July 10, 2012 18:05
active page
function _setActivePageStyle(activeLinkEl) {
//If the active link is not an 'a' element, find it and use it.
if(activeLinkEl.tagName !== 'A') {
activeLinkEl = SELECT.query('a', activeLinkEl, true);
}
//show hidden active element by expanding it's parent category
if(activeLinkEl.parentNode.getAttribute('role') === 'page') {
var parentCategory = DOM.getAncestorByClassName(activeLinkEl, 'category');
@tkh44
tkh44 / SublimeLinter.sublime-settings
Created July 23, 2012 19:02
SublimeLinter Configuration
/*
SublimeLinter default settings
*/
{
/*
Sets the mode in which SublimeLinter runs:
true - Linting occurs in the background as you type (the default).
false - Linting only occurs when you initiate it.
"load-save" - Linting occurs only when a file is loaded and saved.
@tkh44
tkh44 / regex.js
Created July 30, 2012 18:10
password regex
/^.*(?=(?:.*?[0-9]){2})[A-Za-z0-9#,.\-_]{8,15}$/
@tkh44
tkh44 / data.txt
Created August 5, 2012 00:25
Response Breakdown
Title: Coheed and Cambria cover Gotye's "Somebody That I Used To Know" in the most epic of fashions
Artist: Coheed and Cambria cover Gotyes "Somebody That I Used To Know
Song Title: in the most epic of fashions
Url : http://www.youtube.com/watch?v=WgLaJDLYeZs&feature=related
Title: Neil Young - Heart of Gold
Artist: Neil Young
Song Title: Heart of Gold
Url : http://www.youtube.com/watch?v=Eh44QPT1mPE
@tkh44
tkh44 / spotify.js
Created August 6, 2012 18:57
Spotify track lookup with artist safety.
var _s = require('underscore.string');
var spotify = require('spotifyapi');
exports.getSpotifyLink = function(artist, title) {
var artist = artist;
var title = title;
var results = spotify.search({
method: 'track',
q: title,
@tkh44
tkh44 / bot.py
Created August 14, 2012 21:54
gets info from reddit subreddit
import praw
from pprint import pprint
r = praw.Reddit(user_agent='Reddit Music Bot')
submissions = r.get_subreddit('listentothis').get_top(limit=10)
for submission in submissions:
print '\n%s\n' % submission
pprint(vars(submission))
@tkh44
tkh44 / submission.py
Created August 14, 2012 21:58
submission object
[
'__class__',
'__delattr__',
'__dict__',
'__doc__',
'__eq__',
'__format__',
'__getattr__',
'__getattribute__',
'__hash__',
@tkh44
tkh44 / cssregex.txt
Created September 7, 2012 23:20
Find css block regex
#cpanel \{\W.*\W.*\}
Where selector is the css selector you want to find.