Wednesday 28 April 2010

Renaming XCode projects


Copy/rename the folder into new name
Get inside the new folder and rename the .pch and .xcodeproj files
Delete the build folder
Open .xcodeproj file in text editor, like TextMate or TextWrangler. That’s actually a folder, which contains 4 files (you can also right-click and do Show package contents, which will reveal the files)
Open project.pbxproj in text editor and replace all instances of the old name with the new name
Load the project file in XCode, do Build/Clean all targets

Monday 19 April 2010

convert aif to mp3

ffmpeg -i some.aif -f mp3 -ab 192 -ar 44100 some.mp3

Wednesday 14 April 2010

emacs and etags

create tags file:

find . -name '*.cpp' -o -name '*.h' -o -name '*.c' | xargs etags -a -o tags

M-. go to symbol def
M-0 M-. next
M-* return
M-X tags-search
M-, next match

Wednesday 7 April 2010

Alpha compositing with rmagick

Source


















Destination



















Result



















Ruby source:

require 'rubygems'
require 'RMagick'

include Magick

dst = Image.read("dst.png")[0]
src = Image.read("src.png")[0]

result = dst.composite(src, 0, 0, OverCompositeOp)
result.write("result.png")
result.display

exit