Skip to content

Instantly share code, notes, and snippets.

@pablasso
pablasso / Macros.h
Last active October 13, 2015 07:07
I usually import this on my prefix.pch
// by Marcus Zarra
#ifdef DEBUG
#define DLog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#define ALog(...) [[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__]
#else
#define DLog(...) do { } while (0)
#ifndef NS_BLOCK_ASSERTIONS
#define NS_BLOCK_ASSERTIONS
#endif
#define ALog(...) NSLog(@"%s %@", __PRETTY_FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
@phoboslab
phoboslab / gist:3939020
Created October 23, 2012 14:21
AnalogStick plugin
ig.module(
'plugins.analog-stick'
)
.requires(
'impact.system'
)
.defines(function(){
ig.AnalogStick = ig.Class.extend({
stickSize: 30,
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@phoboslab
phoboslab / touch-button.js
Last active August 10, 2021 14:44
Touch Button Plugin for Impact
ig.module(
'plugins.touch-button'
)
.requires(
'impact.system',
'impact.input',
'impact.image'
)
.defines(function(){ "use strict";
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 14, 2025 00:29
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@mutru
mutru / gist:3505854
Created August 29, 2012 01:16
config/god/resque_scheduler.god
rails_env = ENV['RAILS_ENV']
raise "Please specify RAILS_ENV." unless rails_env
rails_root = ENV['RAILS_ROOT'] || File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
God.watch do |w|
w.dir = "#{rails_root}"
w.name = "resque-scheduler"
w.group = 'resque'
w.interval = 30.seconds
w.env = {"RAILS_ENV"=>rails_env, "BUNDLE_GEMFILE"=>"#{rails_root}/Gemfile"}
@mutru
mutru / gist:3505849
Created August 29, 2012 01:15
config/god/resque.god
rails_env = ENV['RAILS_ENV']
raise "Please specify RAILS_ENV." unless rails_env
rails_root = ENV['RAILS_ROOT'] || File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
RESQUE_PROCESSORS = [
[1, "foo,bar"],
[2, "baz"],
[3, "demo"]
]
@zenkay
zenkay / gist:3237860
Created August 2, 2012 15:19
Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@prabirshrestha
prabirshrestha / TextFieldChanges.m
Created August 2, 2012 13:53
Reactive Cocoa examples
@synthesize firstName = _firstName;
@synthesize txtFirstName = _txtFirstName;
[RACAbleSelf(self.firstName) subscribeNext:^(id x) { [self firstNameChanged:x]; }];
[self rac_bind:RAC_KEYPATH_SELF(self.firstName) to:self.txtFirstName.rac_textSubscribable];
- (void) firstNameChanged:(id)firstName {
NSLog(@"changed: %@", firstName);
}