Skip to content

Instantly share code, notes, and snippets.

View MSch's full-sized avatar

Martin Schürrer MSch

View GitHub Profile
OLog(@"asd ", self, aNotification, @"asd qwe", aNotification, self);
2011-07-04 01:14:49.844 Fragments[74240:707] [AppDelegate.m:21] @"asd ",
self = <AppDelegate: 0x100139910>,
aNotification = NSConcreteNotification 0x1001629d0 {name = NSApplicationDidFinishLaunchingNotification; object = <NSApplication: 0x100120e30>; userInfo = {
NSApplicationLaunchIsDefaultLaunchKey = 0;
}},
asd qwe,
aNotification = NSConcreteNotification 0x1001629d0 {name = NSApplicationDidFinishLaunchingNotification; object = <NSApplication: 0x100120e30>; userInfo = {
NSApplicationLaunchIsDefaultLaunchKey = 0;
// Part of FoundationKit http://foundationk.it
// based off http://www.dribin.org/dave/blog/archives/2008/09/22/convert_to_nsstring/ licensed under WHATVER
#import WHATEVER
@MSch
MSch / build-phase.sh
Created October 20, 2011 17:47 — forked from aquarius/gist:1295218
Runs script build phase "Add git ref/tag to Info.plist"
defaults write "${TARGET_BUILD_DIR}"/"${CONTENTS_FOLDER_PATH}"/Info GitVersion `git describe --always --tags --dirty`
enum __app_state {
AppStateDisconnected = 0,
AppStateLookingForDevice,
AppStateConnecting,
AppStateConnected,
};
typedef enum __app_state app_state_t;
#!/usr/bin/env ruby
require 'digest/sha1'
require 'io/console'
ALPHABET = ('0'..'9').to_a + ('a'..'z').to_a + ('A'..'Z').to_a
def hmac(key, msg)
split_at = (key.length / 2).floor
defaults write "${TARGET_BUILD_DIR}"/"${CONTENTS_FOLDER_PATH}"/Info GitVersion `git describe --always --dirty`
<scenes>
<scene sceneID="0w1-E2-N09">
<objects>
<placeholder placeholderIdentifier="IBFirstResponder" id="qgN-yu-YsU" userLabel="First Responder" sceneMemberID="firstResponder"/>
<tableViewController id="baW-xq-PM6" customClass="ASViewController" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="qpc-DA-sEg">
<rect key="frame" x="0.0" y="20" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
# Add all gems in the global gemset to the $LOAD_PATH so they can be used even
# if they're not in the Gemfile. e.g. pry
if defined?(::Bundler)
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
gem_path = "#{p}/lib"
$LOAD_PATH << gem_path
end
require 'benchmark'
# The original implementation by Daniel DeLorme
# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/256662
class NilClass
def ergo
@blackhole ||= Object.new.instance_eval do
class << self
for m in public_instance_methods
@MSch
MSch / config.ru
Created February 15, 2012 06:46
stupid simple rack app to proxy to a local rails app
# Ever wanted to have http://whatever.dev proxy to your script/server?
Forget all this, just use https://github.com/spagalloco/pow_proxy