Skip to content

Instantly share code, notes, and snippets.

View moonhouse's full-sized avatar

David Hall moonhouse

View GitHub Profile
@mbostock
mbostock / .block
Last active November 14, 2023 03:46
Google Maps + D3
license: gpl-3.0
@javan
javan / gist:1168475
Created August 24, 2011 16:32
Fix iPhone home button
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/
1.) Open any application
2.) Press and hold the power button until the slide to shutdown swipe bar appears.
3.) Release Power button
4.) Press and hold Home button Lightly
until screen returns to icon screen

Sample PHP+Mongo app on Heroku

  1. Install any of the Mongo add-ons available at http://addons.heroku.com

  2. Vendor the Mongo driver with your application. You can download it here:

    https://github.com/wuputah/heroku-libraries/raw/master/php/mongo/mongo.so
    

    Add it to a folder like "ext".

@terinjokes
terinjokes / bmdclient
Created January 14, 2012 15:18
bmdclient/ffmpeg
TheMacBookPro:2012-01-14 terin$ ~/Downloads/bmdclient -verbose
Parameters:
Destination File: atem.ts
Source Window:
fps: 25
srcx: 0
srcy: 0
srcw: 1920
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@jmah
jmah / Random Unwatched Movie.applescript
Created May 16, 2012 21:16
Suggest an unwatched movie from Delicious Library
tell front document of application "Delicious Library 2"
-- Choose a random unwatched movie
set unwatchedItems to every movie whose experienced is false
if (count of unwatchedItems) is 0 then
display dialog "You don't have any unwatched movies." buttons {"OK"} default button "OK"
return
end if
set randomIndex to random number from 1 to (count of unwatchedItems)
set candidateItem to item randomIndex of unwatchedItems
@jmah
jmah / Ratings.scpt
Created May 17, 2012 20:52
Basic example AppleScript for Delicious Library
tell front document of application "Delicious Library 2"
set howMany to count of (every medium whose rating ≥ 4)
end tell
tell application "TextEdit"
make new document with properties ¬
{text:"There are " & howMany & " items in Delicious Library rated at least 4 stars."}
end tell
@brianjriddle
brianjriddle / post-merge.sh
Created May 30, 2012 09:34
git post commit hook to trigger if commit message has a key word that starts with %
#!/bin/sh
#will priint out a message if a commit contains a keyword prefixed with %
#
MARKERS="%\w+"
RELEASE=$(git log $(git reflog -n 1 | cut -d ":" -f1) | grep -Pio "$MARKERS"| sort -fu | tr '\n' ' ')
if [ "$RELEASE" != "" ];
then
@rsms
rsms / extract-aperture-images.js
Created August 9, 2012 07:16
Aperture library extractor -- copies all source images from a apimportgroup inside a aplibrary into any folder.
// Aperture library extractor -- copies all source images from a apimportgroup inside a aplibrary
// into any folder.
//
// Step 1. Create a new folder somewhere, for instance in ~/ap-rescue
//
// Step 2. Run this program, giving it the apimportgroup as the first argument and your
// destination directory as the second argument.
//
// e.g. node extract-aperture-images.js ~/'Pictures/Aperture Library 2000.aplibrary/Arkivet.approject/2006-01-15 @ 03:57:21 PM - 1.apimportgroup' ~/ap-rescue
//
@chrjoh
chrjoh / aprompt.png
Created September 24, 2012 06:48 — forked from mislav/aprompt.png
My zsh prompt. No oh-my-zsh needed
aprompt.png