Skip to content

Instantly share code, notes, and snippets.

View jonathansick's full-sized avatar

Jonathan Sick jonathansick

View GitHub Profile
@tylermenezes
tylermenezes / drafttypekit.userscript.js
Created December 9, 2013 22:35
Adds a personal Typekit kit to Draft
// ==UserScript==
// @name Draft Typekitizer
// @namespace http://tyler.menez.es/
// @version 1
// @description Adds Typekit to Draft
// @match http*://*.draftin.com/*
// @copyright 2013 Tyler Menezes
// ==/UserScript==
(function() {
@tonyseek
tonyseek / README.rst
Last active November 5, 2022 15:20
Build Python binding of C++ library with cffi (PyPy/Py3K compatible)

Run with Python:

pip-2.7 install cffi
PYTHON=python2.7 sh go.sh

Run with PyPy:

pip-pypy install cffi
PYTHON=pypy sh go.sh
@markjaquith
markjaquith / gist:7029068
Created October 17, 2013 17:37
How to get git-svn working in OS X Mavericks with Homebrew
sudo xcodebuild -license
xcode-select --install # There will be a GUI prompt
sudo cpan SVN::Core # use the "sudo" method when prompted
# Then add this to your ~/.profile:
# export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH
# Then probably:
brew reinstall git
brew reinstall subversion
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@trey
trey / Gruntfile.js
Last active October 22, 2018 12:59
This is a braindump of the first time I was actually able to get Grunt to do all of what I wanted.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {},
}
},
@Cairnarvon
Cairnarvon / pypistats.py
Created February 5, 2013 15:17
Graphs downloads per day for PyPI packages using gnuplot, because vanity. Usage: ./pypistats.py packagename
#!/usr/bin/env python
import bz2
import datetime
import os
import sys
import time
import urllib2
import warnings
@adrn
adrn / density_contour.py
Created November 1, 2012 14:35
Make a 2D density contour plot with matplotlib
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as so
def find_confidence_interval(x, pdf, confidence_level):
return pdf[pdf > x].sum() - confidence_level
def density_contour(xdata, ydata, nbins_x, nbins_y, ax=None, **contour_kwargs):
""" Create a density contour plot.
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
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:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 1, 2024 03:34
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@cjolly
cjolly / pg.sh
Last active July 25, 2022 20:16
Use homebrew to upgrade to postgres on OSX
newpg=9.6.1 # set to new PG version number
oldpg=`pg_config --version | cut -d' ' -f2`
# PG 96. upgrades the readline to v7, which breaks anything linked against readline v6, like ruby via ruby-build.
# I *think* this should prevent it from installing v7. But if weird shit happens with various rubies,
# you'll have to reinstall them.
brew pin readline
# Stop current Postgres server
brew services stop postgresql