Skip to content

Instantly share code, notes, and snippets.

@l4u
l4u / optimize.rb
Created March 31, 2012 11:14
Optimizing PNGs
Dir.glob("**/*.png").each do |file|
['pngnq -e .png -f', 'pngquant -f -speed 1 -ext .png', 'pngcrush'].each do |command|
puts "#{command} #{file}"
`#{command} #{file}`
end
end
@l4u
l4u / Guardfile
Created March 31, 2012 11:15
guard with guard-shell, down size retina image, hd to sd with imagemagick
guard :shell do
watch(%r{-hd\.png$}) do |m|
input = m[0]
output = input.gsub(/-hd.png$/,'.png')
puts "Downsizing #{input} to #{output}"
`convert #{input} -resize 50% #{output}`
end
end
/usr/local/Cellar/autoconf213/2.13/bin/autoconf213
@l4u
l4u / gist:2393085
Created April 15, 2012 14:18
Network Libraries iOS
https://github.com/probablycorey/seriously
http://aws.amazon.com/sdkforios/
http://restkit.org/
http://projects.lukeredpath.co.uk/resty/
https://github.com/gowalla/AFNetworking
http://getsharekit.com/
https://github.com/pokeb/asi-http-request
https://github.com/robbiehanson/CocoaAsyncSocket
@l4u
l4u / gen_podspec.rb
Created April 19, 2012 12:57
Generate cocoapods podspec for cocos2d-iphone-extensions subspec
exts= [
'CCBigImage',
'CCLayerPanZoom',
'CCMenuAdvanced',
'CCMenuItemSpriteIndependent',
'CCScrollLayer',
'CCSendMessages',
'CCSlider',
'CCVideoPlayer',
'FilesDownloader',
@l4u
l4u / gist:2491639
Created April 25, 2012 17:51
Surprised by how simple it is to use mochijson2 in elixir
import Erlang.mochijson2
Erlang.mochijson2.decode "[1,2,3]"
@l4u
l4u / gist:2495269
Created April 26, 2012 02:27
vimrc for erlang elixir
au BufRead,BufNewFile *.app.src set filetype=erlang
Bundle 'oscarh/vimerl'
Bundle 'elixir-lang/vim-elixir'
Bundle 'carlosgaldino/elixir-snippets'
@l4u
l4u / gist:2508381
Created April 27, 2012 10:55
erlang backpack
heroku create -s cedar
heroku config:add BUILDPACK_URL=http://github.com/heroku/heroku-buildpack-erlang.git
@l4u
l4u / gist:2575503
Created May 2, 2012 09:27
Erlang JSON library
https://github.com/talentdeficit/jsx
https://github.com/davisp/jiffy
mochijson2
https://github.com/jchris/erlang-json-eep-parser
https://github.com/klacke/yaws/blob/master/src/json2.erl
https://github.com/davisp/eep0018
@l4u
l4u / gist:2583070
Created May 3, 2012 04:07
Chicagoboss tutorial output json
-module(cb_tutorial_greeting_controller, [Req]).
-compile(export_all).
hello('GET', []) ->
{json, [{greeting, "Hello, world!"}]}.
list('GET', []) ->
Greetings = boss_db:find(greeting, []),
case Greetings of
[] ->
{output, <<"[]">>, [{"Content-Type", "application/json"}]};