Skip to content

Instantly share code, notes, and snippets.

View benspaulding's full-sized avatar

Ben Spaulding benspaulding

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spookylukey
spookylukey / gist:fc9fa268de67fd19a567
Last active August 29, 2015 14:22
How to post code snippets (especially Python) into comment systems that don't preserve whitespace
#!/usr/bin/env python
# How to post code snippets (especially Python) into comment systems
# that don't preserve whitespace.
# Save this as a script called 'convert_leading_spaces_to_nonbreaking'
# in your PATH and do "chmod +x" on it.
#
# In Linux, you can then use it by installing xsel and doing:
#
@westphahl
westphahl / gist:360442
Created April 8, 2010 19:35
logrotate.d script for Nginx
/var/log/nginx/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
@mcroydon
mcroydon / main.py
Created March 25, 2011 05:00
Source to isitfridayfridayfriday.appspot.com
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
class IsItFridayFridayFridayHandler(webapp.RequestHandler):
def get(self):
self.response.out.write("""<html><head><title>Is it Friday Friday Friday?</title>
<style type="text/css">
.big {font-size: 5em; margin-top: 2.5em; margin-bottom: 1em;}
.center {text-align: center;}
.friday {color: green;}
@toastdriven
toastdriven / mytwilight.tmTheme
Created July 29, 2011 16:04 — forked from epicserve/sublime_text_2_notes.md
My Sublime Text 2 Setup
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Daniel Lindsley</string>
<key>name</key>
<string>My Twilight</string>
<key>settings</key>
<array>
@toastdriven
toastdriven / congress_people.txt
Created November 16, 2011 16:58
For Lawrencians.
Rep. Lynn Jenkins
District: FH-KS02
KS
Phone:(202) 225-6601
Fax:(202) 225-7986
Sen. Pat Roberts
KS
@jefftriplett
jefftriplett / fabfile.py
Created May 4, 2012 01:25
A very basic python + fabric + boto script for setting up a VPN using EC2
'''
Warning! Your mileage may vary
Based on:
- Read this for EC2 setup info and the approach - http://www.dikant.de/2010/10/08/setting-up-a-vpn-server-on-amazon-ec2/
- https://gist.github.com/1130401
- EC2 fabric bits via - https://github.com/slacy/fabric-ec2
'''
include:
- pil
apache2:
pkg:
- installed
build-essential:
pkg.installed
@idan
idan / customstorages.py
Created November 3, 2012 20:15
Protocol-Relative S3BotoStorage for django-storages
from urlparse import urlsplit, urlunsplit
from storages.backends.s3boto import S3BotoStorage
class ProtocolRelativeS3BotoStorage(S3BotoStorage):
"""Extends S3BotoStorage to return protocol-relative URLs
See: http://paulirish.com/2010/the-protocol-relative-url/
"""
@jkocherhans
jkocherhans / gist:5238719
Last active December 15, 2015 09:29
Non-profits for programming education and diversity
http://adainitiative.org
"The Ada Initiative is a non-profit organization supporting women
in open technology and culture. We educate people of all genders
on how to support women in open tech/culture through teaching
workshops, writing policies, guides, and editorials, and speaking."
http://openhatch.org
"OpenHatch is a non-profit that maintains this website, organizes
outreach events to grow the open source community, and brings
diversity to programming groups."