Skip to content

Instantly share code, notes, and snippets.

View sigmavirus24's full-sized avatar
🌴
Taking a break from F/OSS indefinitely

Ian Stapleton Cordasco sigmavirus24

🌴
Taking a break from F/OSS indefinitely
View GitHub Profile
@defunkt
defunkt / clients.md
Created April 18, 2010 14:09
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@tdreyno
tdreyno / solarized.css
Created August 4, 2011 17:32
Solarized Pygments CSS
.hll { background-color: #ffffcc }
.c { color: #586E75 } /* Comment */
.err { color: #93A1A1 } /* Error */
.g { color: #93A1A1 } /* Generic */
.k { color: #859900 } /* Keyword */
.l { color: #93A1A1 } /* Literal */
.n { color: #93A1A1 } /* Name */
.o { color: #859900 } /* Operator */
.x { color: #CB4B16 } /* Other */
.p { color: #93A1A1 } /* Punctuation */
@ravasthi
ravasthi / _config.yml
Created February 15, 2012 08:59
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: hanzou@company.com
web: http://company.com
twitter: company
github: hhattori
jorgen:
@kennethreitz
kennethreitz / pr.md
Created September 12, 2012 20:56 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@durden
durden / class_state_watcher.py
Created November 15, 2012 21:44
Watch when variables change in your class
def watch_variables(var_list):
"""Usage: @watch_variables(['myvar1', 'myvar2'])"""
def _decorator(cls):
def _setattr(self, name, value):
if name in var_list:
import traceback
import sys
# Print stack (without this __setattr__ call)
traceback.print_stack(sys._getframe(1))
print '%s -> %s = %s' % (repr(self), name, value)
#!/usr/bin/python
#
# Jordan Scales (http://jordanscales.com)
# 5/1/13
#
# A walkthrough of a simple (but useful!) use of decorators to memoize functions
def memoize(f):
if not hasattr(f, 'cache'): # define a `cache` property on our function
f.cache = {} # if we haven't already
@GrahamDumpleton
GrahamDumpleton / gist:6694421
Last active December 23, 2015 21:09
PASS/FAIL matrix for various requests module versions and proxy SSL request via Squid.

Squid configuration:

http_port 3128
https_port 3129 cert=/usr/local/opt/squid/etc/ssl/squid.crt key=/usr/local/opt/squid/etc/ssl/squid.key

Test names:

The 'http_port' annotation indicates whether Squid HTTP port was used.

The 'https_port' annotation indicates whether Squid HTTPS port was used.

etamax_cassette = pytest.mark.betamax_cassette
class TestGitHubAPI:
def test_user(self, session, vcr):
vcr.use_cassette('user')
resp = session.get('https://api.github.com/user',
auth=('user', 'pass'))
assert resp.json()['login'] is not None
require 'mechanize'
name = ARGV[0] # Email or Card Number
pass = ARGV[1] # Password
agent = Mechanize.new
login = agent.get 'http://colectivocoffee.com/loyalty/member-login/'
form = login.forms.first
form.email_number = name
@pascalpoitras
pascalpoitras / config.md
Last active June 6, 2024 13:09
My WeeChat configuration

WeeChat Screenshot

Mouse


enable