Skip to content

Instantly share code, notes, and snippets.

@cowboy
cowboy / finder-open-iterm-here.scpt
Created April 6, 2011 12:10
Finder Open iTerm Here: Drop a folder on this script (or just run it) to open a new iTerm window there. If the selected item isn't a folder, it will open the item's parent folder. Great when bound to a hotkey in FastScripts or added to the Finder Sidebar
(*
* Finder Open iTerm Here - v1.0.2 - 4/14/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*)
tell application "Finder"
@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@maxim75
maxim75 / set_loc.py
Created May 22, 2011 01:07
Setting GPS location EXIF tags using Python script and pyexiv2 library
#!/usr/bin/env python
import pyexiv2
import fractions
from PIL import Image
from PIL.ExifTags import TAGS
import sys
def to_deg(value, loc):
if value < 0:
@davidmarble
davidmarble / patch_model.py
Created November 28, 2011 21:02
Monkey patch django built-in models so that any fields can be overwritten or added
from django.db.models.fields import Field
import types
def patch_model(model_to_patch, class_to_patch_with):
"""
Adapted from http://www.ravelsoft.com/blog/2010/patchmodel-hacky-solution-extending-authuser-class
Monkey patch a django model with additional or replacement fields and methods.
All fields and methods that didn't exist previously are added.
@dshafik
dshafik / hl.py
Created March 25, 2012 10:56
CLI syntax highlighter
#!/usr/bin/env python
"""
Highlight stdin using pygments and output to stdout
Re-uses httpie.
Auto-detects the input language.
Will not colorize if piped into something else.
@jassinm
jassinm / gist:3200136
Created July 29, 2012 16:44
scipy , numpy , matplotlib on clean install mac osx 10.8 mountain lion
brew install python
easy_install pip
#install scipy use temp branch
pip install git+https://github.com/minrk/scipy-1.git@accelerate
#ft2build.h not found ==>
pip install git+git://github.com/matplotlib/matplotlib.git
@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:

@kiddouk
kiddouk / gist:3491408
Created August 27, 2012 19:11
Redis Async read/write in IOLoop
redis_parser = Reader()
redis_write_buffer = deque()
def create_redis_socket(host, port):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1)
sock.connect((host, port))
sock.setblocking(0)
return sock
@jlongster
jlongster / touch.css
Created September 11, 2012 19:20
Web Audio API demo (iOS 6, Chrome) - The Web is a Platform
html, body {
background-color: black;
width: 100%;
height: 100%;
margin: 0;
}
canvas {
display: block;
margin: 0;
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: