Skip to content

Instantly share code, notes, and snippets.

View boennemann's full-sized avatar

Stephan Bönnemann-Walenta boennemann

View GitHub Profile
@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
@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
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
@cowboy
cowboy / grunt-subgrunt.js
Created October 2, 2012 13:31
Grunt 0.4.0a (devel) Run a subproject's grunt tasks.
/*
* grunt-subgrunt
* http://gruntjs.com/
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
*/
'use strict';
@mikeal
mikeal / gist:6685843
Last active December 23, 2015 19:58
Response to comments by Issac Roth of StrongLoop

This is rather out of date and we've all moved past it. Me and Issac are cool now.

pic

When a beginner asks you "when do I use semi-colons?" would you rather say this?

// what people who say "use semicolons!!" say
class Foo {
  prop = {
  }; // yes
@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',
@sindresorhus
sindresorhus / more-mute-regex.md
Created October 18, 2012 08:14 — forked from jimmynotjim/more-mute-regex.md
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.

##Simply annoying Tweets

Annoyingly extended words (4+ of the same letter in a phrase): OOOOHHHHMMMMYYYYGGGGOOOODDDD

([a-z])/1{4}

Tweet w/ just a single hashtag: #omgthissucks

^ *#[^ ]+$
# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
@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 );