Skip to content

Instantly share code, notes, and snippets.

View georgkreimer's full-sized avatar
☠️
Hack the planet!

Georg Kreimer georgkreimer

☠️
Hack the planet!
View GitHub Profile
@georgkreimer
georgkreimer / omg.rb
Created October 28, 2011 23:39 — forked from tenderlove/omg.rb
###
# Read in XML as a stream, write out JSON as a stream. As little information
# is kept in memory as possible.
require 'nokogiri'
require 'psych'
class JSONTranslator < Nokogiri::XML::SAX::Document
attr_reader :emitter
def initialize emitter
@georgkreimer
georgkreimer / face_detector.rb
Created December 7, 2011 17:30 — forked from pvinis/face_detector.rb
run with "macruby face_detector.rb" or "macruby face_detector.rb https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/304055_10150415385415891_522505890_10347873_1682210515_n.jpg?dl=1" for a photo of me with woody and buzz lightyear :p
framework 'Cocoa'
class NSColor
def toCGColor
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace)
## approach #1
# components = Array.new(4){Pointer.new(:double)}
# color_RGB.getRed(components[0],
# green: components[1],
# blue: components[2],
@georgkreimer
georgkreimer / hack.sh
Created March 31, 2012 18:36 — forked from erikh/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
#
@georgkreimer
georgkreimer / gist:2654007
Created May 10, 2012 15:42 — forked from marcel/gist:2100703
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@georgkreimer
georgkreimer / sphinx.rb
Created May 13, 2012 22:18 — forked from alexstubbs/sphinx.rb
Brew formula for install sphinx 0.9.8.1 based on homebrew formula sphinx 2.0.4 git checkout 8dbb32e /usr/local/Library/Formula/sphinx.rb
require 'formula'
class Libstemmer < Formula
# upstream is constantly changing the tarball,
# so doing checksum verification here would require
# constant, rapid updates to this formula.
head 'http://snowball.tartarus.org/dist/libstemmer_c.tgz'
homepage 'http://snowball.tartarus.org/'
end
@georgkreimer
georgkreimer / spotify_mute_ads.rb
Created June 14, 2012 14:52 — forked from v1rtual/spotify_mute_ads.rb
Mute Spotify ads on OS X
# coding: utf-8
#!/usr/bin/env ruby
#
# Mutes Spotify ads by monitoring Growl's output in syslog, and changing the
# system-wide audio output to dummy output when an ad is detected.
#
# == Installation
#
# 1. Install Soundflower (http://code.google.com/p/soundflower/)
# 2. download gist
@georgkreimer
georgkreimer / mobile-safari-inspector
Created June 28, 2012 17:34
Configure Mobile Safari on the Simulator allow remote debugging of web pages and open safari to view the inspector.
#!/bin/sh
#
# Configure Mobile Safari on the Simulator allow remote debugging of web pages
# and open safari to view the inspector.
#
# If you want to open the Simulator from the command line you might like the
# following alias:
# alias iphone-simulator="open /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app"
#
require 'formula'
class Subversion < Formula
homepage 'http://subversion.apache.org/'
url 'http://apache.spinellicreations.com/subversion/subversion-1.7.11.tar.bz2'
sha1 'd82e187803043b74c072cd5a861ac02e4a027684'
option :universal
option 'java', 'Build Java bindings'
option 'perl', 'Build Perl bindings'
@georgkreimer
georgkreimer / Console.log
Created September 5, 2013 01:23
embedded issue: "has no method 'map'"
DEBUG: ------------------------------- ember.js:394
DEBUG: Ember.VERSION : 1.0.0 ember.js:394
DEBUG: Handlebars.VERSION : 1.0.0 ember.js:394
DEBUG: jQuery.VERSION : 1.10.2 ember.js:394
DEBUG: ------------------------------- ember.js:394
Uncaught TypeError: Object function () {
if (!wasApplied) {
Class.proto(); // prepare prototype...
}
o_defineProperty(this, GUID_KEY, undefinedDescriptor);
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
# install wallpaper cli
gem install desktop
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"