Skip to content

Instantly share code, notes, and snippets.

NSNumber *a;
NSNumber *b;
NSArray *os = @[ [NSValue valueWithPointer:&a],
[NSValue valueWithPointer:&b] ];
for (int i = 0; i<2; i++) {
void *pointer = [[os objectAtIndex:i] pointerValue];
NSNumber *a_ptr_1 = (__bridge NSNumber*)pointer;
@fgarcia
fgarcia / gist:5276818
Created March 30, 2013 14:08
Bogus Podfile?
### Stack
```
CocoaPods : 0.17.0.rc7
Ruby : ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]
RubyGems : 1.8.24
Host : Mac OS X 10.8.3 (12D78)
Xcode : 4.6.1 (4H512)
Ruby lib dir : /Users/kalahan/.rvm/rubies/ruby-1.9.3-p327/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ c0f022c6f6c86b622bb22c0d6439f50c06248c3d
@fgarcia
fgarcia / gist:7524015
Created November 18, 2013 07:34
Objective-C configuration for Uncrustify
#
# uncrustify config file for objective-c and objective-c++
#
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
output_tab_size = 2 # new tab size
indent_columns = output_tab_size
indent_label = 2 # pos: absolute col, neg: relative column
indent_align_assign = FALSE
indent_oc_block = true
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
@fgarcia
fgarcia / dir2dmg.sh
Created December 10, 2013 13:01 — forked from aisrael/dir2dmg.sh
#!/bin/bash
if [ "$#" -eq 0 ]; then
echo "Usage:"
echo " dir2dmg <path/to/directory>"
exit 1
fi
PWD=`pwd`
@fgarcia
fgarcia / bone.rb
Created December 25, 2013 13:50
BareBone Sinatra app that can be launched with Rack
require "sinatra"
class Bone < Sinatra::Base
get "/" do
"hello"
end
run! if app_file == $0
2.1.0 (main):0 > class Bang
2.1.0 (main):0 * def instance_bang
2.1.0 (main):0 * class.class_bang
SyntaxError: unexpected '.'
class.class_bang
^
@fgarcia
fgarcia / gist:8383945
Last active January 3, 2016 00:39
Running the latest version of ZSH the right way

Use brew to make sure you are running the latest version: brew reinstall zsh --enable-etcdir

It will not behave as your /bin/zsh without --enable-etcdir

Change your default shell:

chsh

Speed up your login:

@fgarcia
fgarcia / 0_reuse_code.js
Created January 14, 2014 07:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@fgarcia
fgarcia / gist:8451635
Created January 16, 2014 08:38
This reproduces the exact ENV and PWD captured inside the start-server.sh script
#!/bin/bash
#
# Start CouchBase Server 2.2
##
[ "$HOME" != "" ] && exec -c $0
export SHLVL=1
export HOME=/Users/dominik
export COUCHDB_ADDITIONAL_CONFIG_FILE=/Users/dominik/Library/Preferences/couchbase-server.in