Skip to content

Instantly share code, notes, and snippets.

View boennemann's full-sized avatar

Stephan Bönnemann-Walenta boennemann

View GitHub Profile
@rhussmann
rhussmann / SignInWithTwitter.js
Created September 6, 2010 06:05
Simple 'sign in with Twitter' implementation in node.js
var http = require('http'),
sys = require('sys'),
URL = require('url'),
querystring = require('querystring'),
OAuth = require('oauth').OAuth;
var oa = new OAuth('https://api.twitter.com/oauth/request_token',
'https://api.twitter.com/oauth/access_token',
'YOUR APP CONSUMER KEY HERE',
'YOUR APP CONSUMER SECRET HERE',
@chrisyour
chrisyour / Folder Preferences
Created December 4, 2010 20:05
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@mhammonds
mhammonds / HideMobileAddressBar.js
Created September 3, 2011 03:23
Hide Browser Address Bar - Android + iPhone
function hideAddressBar()
{
if(!window.location.hash)
{
if(document.height < window.outerHeight)
{
document.body.style.height = (window.outerHeight + 50) + 'px';
}
setTimeout( function(){ window.scrollTo(0, 1); }, 50 );
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jvdgoot
jvdgoot / gist:2427304
Created April 20, 2012 09:19
Allow text selection in Quick Look
# Allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
@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"
@rexmac
rexmac / gist:3189232
Created July 27, 2012 17:21 — forked from getify/gist:3185473
attempting to use jParser to extract dimensions of JPG image file
var fs = require("fs");
var jParser = require("jParser");
var eof = false;
fs.readFile("sample.jpg",function(err,data) {
if (!err) {
var view = new jDataView(data, undefined, undefined, false);
var parser = new jParser(view,{
// JPG
@simX
simX / hidpi.txt
Created July 28, 2012 04:58
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
width = 102 # width of rectangle
height = 40 # height of rectangle
pos_x = 3 # x coordinate for entire grid
pos_y = 3 # y coordinate for entire grid
y_margin = 3 # vertical space between rectangles
x_margin = 3 # horizontal space between rectangles
columns = 3 # number of columns
rows = 5 # number of rows
columns.times do |col| # number of columns