Skip to content

Instantly share code, notes, and snippets.

View codysoyland's full-sized avatar

Cody Soyland codysoyland

View GitHub Profile
package main
import (
"log"
"net/http"
"github.com/gorilla/websocket"
)
func main() {
#daniellindsleyrocksdahouse
When Daniel Lindsley calls 1-900 numbers, he doesnt get charged. He holds up the phone and money falls out.
Daniel Lindsley once ate a whole cake before his friends could tell him there was a stripper in it.
Some people like to eat frogs' legs. Daniel Lindsley likes to eat lizard legs. Hence, snakes.
There are no races, only countries of people Daniel Lindsley has beaten to different shades of black and blue.
When Daniel Lindsley was denied an Egg McMuffin at McDonald's because it was 10:35, he roundhouse kicked the store so hard it became a Wendy's.
Daniel Lindsley can't finish a "color by numbers" because his markers are filled with the blood of his victims. Unfortunately, all blood is dark red.
A Daniel Lindsley-delivered Roundhouse Kick is the preferred method of execution in 16 states.
When Daniel Lindsley falls in water, Daniel Lindsley doesn't get wet. Water gets Daniel Lindsley.
class BaseTestCase(TestCase):
@contextmanager
def assert_num_queries(self, n):
current_debug = settings.DEBUG
settings.DEBUG = True
current = len(connection.queries)
yield
self.assertEqual(current+n, len(connection.queries), connection.queries[current:])
settings.DEBUG = current_debug
Business.filter({'name__startswith': 'Free State'}).order_by('name').get(
function(businesses) {
$.each(businesses,
function (business) {
console.log(business);
business.profile.get(
function(profile) {
console.log(profile);
}
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqRTa4T9FyZtMb3w38MkSWSmlkKJjMPopj8ntILv8TYiLDuT8NJdsw+X1d05W1bX/al30JnVRBu1YMTGJsgv7iExcIdQLA5zHFJw6W6UHRvuBTLC4FU7qz515xHvjJAoBtUhXp0WbFt/KUKnpBoGcOH322/DwoiLs7vpk0gwsAW/gGb/ixCTpAW/VLAKpVwC551KRS/UJw8UE9CSBc2CM/M20EDGqL2zrwBOwZ9fzg2k7yfnvQ+BvwqkBM+kAR69FYSLCmVXKQ6CJI7ACralh19CN86/JpLjNYSfhQ06ipRY9goA2m9ESmlnAFesXzDOaWFn+iKhk5Pv9Nyc8tMtcuQ== csoyland@065.newsctr.ljworld.com
from piston.handler import BaseHandler
from piston.emitters import Emitter
def serialize(data):
return Emitter(data, {}, BaseHandler).construct()
[user]
email = codysoyland@gmail.com
name = Cody Soyland
[color]
ui = true
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
from HTMLParser import HTMLParser
import sys
import pprint
import urllib
from pip.commands.search import highest_version
import pkg_resources
class PyPISearchParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
# working with mercurial, the easy way
# requires hg-git
hg clone http://bitbucket.org/ianb/pip
cd pip
hg bookmark hg/default
hg gexport
ln -s .hg/git .git
echo ".hg" >> .git/info/exclude
git reset hg/default
diff --git a/tastypie/api.py b/tastypie/api.py
index 0344a81..b4f2adc 100644
--- a/tastypie/api.py
+++ b/tastypie/api.py
@@ -50,6 +50,19 @@ class Api(object):
# Register it globally so we can build URIs.
_add_resource(self, resource, canonical)
+ def register_representation(self, representation, name, canonical=True):
+ """