Skip to content

Instantly share code, notes, and snippets.

@richleland
richleland / ssl_via_proxy.py
Last active December 14, 2015 04:19 — forked from schlamar/gist:2993700
Code for handling https requests via proxy
import httplib
import urllib2
import ssl
import certifi
from backports.ssl_match_hostname import match_hostname
class CertValidatingHTTPSConnection(httplib.HTTPConnection):
default_port = httplib.HTTPS_PORT
@richleland
richleland / knife.rb
Created August 29, 2012 02:42 — forked from zzondlo/knife.rb
My Generic knife.rb
### Chef Solo
#
#
### Opscode Hosted Chef Server
#
# export KNIFE_USER="jdoe"
# export KNIFE_ORGNAME="acmeco"
#
# * Your Opscode client key should be at `~/.chef.d/opscode-jdoe.pem`.
# * Your Opscode validation key should be at `~/.chef.d/opscode-acmeco-validator.pem`.
@richleland
richleland / eventcmd
Created June 10, 2011 14:47 — forked from tupton/eventcmd
An example eventcmd script for posting pianobar events to Last.fm with Scrobbular.
#!/bin/bash
# create variables
while read L; do
k="`echo "$L" | cut -d '=' -f 1`"
v="`echo "$L" | cut -d '=' -f 2`"
export "$k=$v"
done < <(grep -e '^\(title\|artist\|album\|stationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\)=' /dev/stdin) # don't overwrite $1...
username='<YOUR GOOGLE USERNAME>';
/*!
* Fade Out element and remove from DOM
*/
(function($)
{
$.fn.fadeOutAndRemove = function(duration)
{
duration = (duration === undefined) ? 250 : duration;
return this.fadeOut(duration, function()
emacs -q --eval '(condition-case err (progn (load "~/.emacs") (kill-emacs 0)) (error (kill-emacs 1)))'
# Source http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/bed5b2bd8b237f5a?pli=1
@richleland
richleland / .hgrc
Created January 14, 2010 17:27 — forked from joshourisman/.hgrc
[ui]
username = Josh Ourisman <josh@joshourisman.com>
[extensions]
fetch=
hgext.mq=
hgext.convert=
color=
rebase=
hgsubversion=~/.hg.d/hgsubversion/hgsubversion