Skip to content

Instantly share code, notes, and snippets.

View kennethreitz's full-sized avatar
🐍

Kenneth Reitz kennethreitz

🐍
View GitHub Profile
@kennethreitz
kennethreitz / Dockerfile
Last active August 29, 2015 14:20
Python buildpack attempt within Dockerifle
FROM heroku/cedar:14
RUN useradd -d /app -m app
USER app
WORKDIR /app/src
ENV HOME /app
ENV PORT 3000
ENV PATH /app/.heroku/python/bin:/tmp/python-pack/bin:$PATH
ENV STACK cedar-14
@kennethreitz
kennethreitz / .bash_profile.sh
Created October 27, 2009 16:58
My .bashrc configuration
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
@kennethreitz
kennethreitz / populus-codes.txt
Created November 28, 2009 03:05
Populus Sheild Codes
Inside of shield World
---------------- --------
6 large blocks HURTUOLD
Heavy vertical lines JOSDEBOY
Light vertical lines MORYDOR
Light horizontal lines TIMDIDOR
Heavy horizontal lines CALKOPPAL
Heavy diagonal lines SCOQAZPERT
Heavy diagonal lines BURSODJOB
Light diagonal lines SWAELAS
@kennethreitz
kennethreitz / reset.css
Created December 20, 2009 01:35
The best darn CSS Reset Around
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
@kennethreitz
kennethreitz / js_redirect_example.html
Created January 20, 2010 14:39
Proper XHTML header
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
</html>
@kennethreitz
kennethreitz / browser
Created March 3, 2010 21:47 — forked from defunkt/browser
html | browser
#!/bin/sh -e
#
# Usage: browser
# pipe html to a browser
# e.g.
# $ echo "<h1>hi mom!</h1>" | browser
# $ ron -5 man/rip.5.ron | browser
if [ -t 0 ]; then
cat <<usage
@kennethreitz
kennethreitz / facebook-selectall.js
Created March 7, 2010 16:10
Use this on a facebook select friends invite panel to select everyone.
javascript:elms=document.getElementById('friends').getElementsByTagName('li');for(var fid in elms){if(typeof elms[fid] === 'object'){fs.click(elms[fid]);}}
@kennethreitz
kennethreitz / alt-svnscrub.sh
Created March 8, 2010 20:16
Recursively delete all .svn folders from a working directory.
find . -name .svn -exec rm -rf {} \;
@kennethreitz
kennethreitz / send-via-gmail.py
Created March 9, 2010 16:18
Send a message via Gmail's SMTP servers
import smtplib
to = 'xxxxxx@xxxxxx.com'
gmail_user = 'xxxxxx@gmail.com'
gmail_pwd = 'xxxxxx'
subject = 'xxxxxx'
message = '''
xxxxxx
'''
@kennethreitz
kennethreitz / github-wikistyle.css
Created March 9, 2010 23:30
CSS from GitHub's doc views. Added html wrapper. Great for embedding in HTML documentation.
html{width: 85%; min-width: 600px;margin: 0 auto; font-family: sans-serif;}
h1,h2,h3,h4,h5,h6{border:0!important;}
h1{font-size:170%!important;border-top:4px solid #aaa!important;padding-top:.5em!important;margin-top:1.5em!important;}
h1:first-child{margin-top:0!important;padding-top:.25em!important;border-top:none!important;}
h2{font-size:150%!important;margin-top:1.5em!important;border-top:4px solid #e0e0e0!important;padding-top:.5em!important;}
h3{margin-top:1em!important;}
p{margin:1em 0!important;line-height:1.5em!important;}
ul{margin:1em 0 1em 2em!important;}
ol{margin:1em 0 1em 2em!important;}
ul ul, ul ol, ol ol, ol ul{margin-top:0!important;margin-bottom:0!important;}