Skip to content

Instantly share code, notes, and snippets.

@kennethreitz
kennethreitz / README.rst
Created September 8, 2011 05:57
Plans for Python-Resources.

Resources for Python

RESTful != HTTP.

Work in progress.

This is a framework for bringing RESTful Resources to your Python applications. It can be used in a few ways:

  • To add a RESTful interface to your existing codebase.
@jacobb
jacobb / key_bindings.json
Created August 30, 2012 19:15
sublimetext 2 conf
[
{ "keys": ["ctrl+f"], "command": "indentxml" },
{ "keys": ["super+k", "super+b"], "command": "toggle_side_bar" },
{
"keys": ["super+shift+2"],
"command": "set_layout",
"args":
{
"cols": [0.0, 1.0],
"rows": [0.0, 0.5, 1.0],
import time
from redis import ConnectionPool, Redis
class WaitingConnectionPool(ConnectionPool):
"Connection Pool that blocks if a connection is not available"
def make_connection(self):
while True:
if self._created_connections >= self.max_connections:
time.sleep(0.01)
self._created_connections += 1
@ionelmc
ionelmc / requirements.txt
Created May 9, 2013 15:33
golden celery
# celery and it's dependencies
amqp==1.0.8
anyjson==0.3.3
kombu==2.5.6
python-dateutil==1.5
billiard==2.7.3.21
celery==3.0.15
anonymous
anonymous / jsbin.UnuQIdU.css
Created October 8, 2013 17:50
header{
width:100%;
height:200px;
background:teal;
}
.ad{
width:500px;
height:120px;
margin:0 auto;
@mt3
mt3 / pandas-heroku.md
Created September 8, 2012 23:10 — forked from nicolashery/pandas-heroku.md
Deploy Python app using Pandas on Heroku

Deploy Python app using Pandas on Heroku

2012-09-08

This document explains how to deploy a Python app that uses the Pandas library on Heroku.

Heroku builds Numpy (one of Pandas' requirements) fine. However, when trying to deploy an app with both numpy and pandas in its requirements.txt file (or even just pandas), for some reason it fails

@kennethreitz
kennethreitz / setup.cfg
Created November 15, 2013 18:52
How to add support the wheel format in your package.
[wheel]
universal = 1
@brodul
brodul / streaming.sh
Created July 25, 2012 19:39
Twitch.tv script for streaming
#! /bin/bash
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# gist created by brodul
INRES="1280x800" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution
@giuliomagnifico
giuliomagnifico / padd.sh
Last active January 7, 2023 16:22
Custom PADD layout for 800x480px displays
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC1091
# shellcheck disable=SC2154
# PADD
#
# A more advanced version of the chronometer provided with Pihole
# SETS LOCALE
@jsdf
jsdf / ReactNativeRefreshableListView.js
Last active September 15, 2023 07:29
React Native pull down to refresh ListView
// for an updated version see https://github.com/jsdf/react-native-refreshable-listview
var React = require('react-native')
var {
ListView,
ActivityIndicatorIOS,
StyleSheet,
View,
Text,
} = React