Skip to content

Instantly share code, notes, and snippets.

(app-ticket6904)bash-3.2$ curl http://github.com/api/v1/json/nicksieger | python -msimplejson.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5635 100 5635 0 0 25522 0 --:--:-- --:--:-- --:--:-- 143k
{
"user": {
"blog": "http://blog.nicksieger.com/",
"email": "[email protected]",
"login": "nicksieger",
"name": "Nick Sieger",
"""
Copyright (c) 2008-2009, Nathan Borror, and modified heavily by Eric Florenzano
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
(when (load "flymake" t)
(load "flymake-cursor" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "/PATH/TO/YOUR/pyflakes" (list local-file))))
from uuid import uuid1
from simplejson import dumps, loads
from urlparse import urlparse
from httplib import HTTPConnection
class Client(object):
def __init__(self, server):
self.server = server
url_parts = urlparse(server)
self.port = url_parts.port
from django.core.cache import cache
from django.conf import settings
from django.contrib.auth.models import User
ONLINE_THRESHOLD = getattr(settings, 'ONLINE_THRESHOLD', 60 * 15)
ONLINE_MAX = getattr(settings, 'ONLINE_MAX', 50)
def get_online_now(self):
return User.objects.filter(id__in=self.online_now_ids or [])
# Copypasta of Django's runserver management command, modified to use gunicorn http://github.com/benoitc/gunicorn
import os
import signal
import sys
import threading
import time
from optparse import make_option
import random
import time
from eventlet import patcher, greenpool, pools
patcher.monkey_patch()
import simplegeo
LAYER = 'your.layer.identifier.here'
OAUTH_KEY = 'YOUR OAUTH KEY HERE'
<ul>
{{#tweets}}
<li>{{text}}</li>
{{/tweets}}
</ul>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>ASDF</title>
<style>
.animate {
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 2s;
-webkit-transform: matrix3d(0.5, -0.5, -0.707107, 0, 0.853553, 0.146447, 0.5, 0, -0.146447, -0.853553, 0.5, 0, 0, 0, 0, 1);
import uuid
import simplejson
import amqplib.client_0_8 as amqp
class SimpleCelery(object):
def __init__(self, task_map, host, port, user, password, exchange, vhost,
ssl=False, retries=5, routing_key='celery'):
self._task_map = task_map