Skip to content

Instantly share code, notes, and snippets.

@idoru
idoru / gist:962723
Created May 9, 2011 15:21
.gitignore for xcode 4 projects
.DS_Store
*.swp
*~.nib
build/
*.pbxuser
*.perspective
*.perspectivev3
@idoru
idoru / convert-assets.sh
Created March 13, 2011 20:55
Automate the creation of low fidelity assets from Retina assets. Uses CoreImageTool by Marc Liyanage (http://www.entropy.ch/software/macosx/coreimagetool/)
#!/bin/sh
#Get CoreImageTool from http://www.entropy.ch/software/macosx/coreimagetool/
CONVERTER=/usr/local/bin/CoreImageTool
for FILE in $(find . -name \*-hd.png)
do
TARGET=$(echo $FILE | sed -e s@-hd\.png@\.png@)
echo $FILE \=\> $TARGET
$CONVERTER load pic $FILE filter pic CILanczosScaleTransform scale=0.5 store pic $TARGET public.png
@idoru
idoru / XCode_SwapBetweenSpec.scpt
Created November 17, 2010 05:36
[Not compatible with XCode 4] Ever wanted to switch between Cedar specs and your implementation with a single keystroke? Well, there's a user script for that!
(*
SwapBetweenSpec.scpt
Get into the BDD groove with this Xcode user script which quickly toggles between your implementation (or header)
and its Cedar Spec. Bind it to your favorite shortcut key and enjoy the cycle.
Be sure to add this User Script to Xcode as an Applescript, not a shell script:
1. Paste the contents of the gist into ~/Library/Application Support/Developer/Shared/Xcode/User Scripts/SwapBetweenSpec.scpt
2. When adding to script in the "Edit User Scripts" window of Xcode, choose "Add Script File..." and not "New Shell Script" and then choose the file from (1)
3. Set Input to "No Input"
@idoru
idoru / appending stderr and stdout to different logfiles and still output to stderr and stdout
Created October 6, 2010 18:25
send stdout and stderr to files but also still output stdout and stderr
(ruby -e 'STDERR.puts("stderr output") ; STDOUT.puts("stdout output") ' | tee -a stdout_logfile.txt) 3>&1 1>&2 2>&3 | tee -a stderr_logfile.txt
if Rails.env.development? || Rails.env.cucumber?
module ActionView
module Partials
def render_partial_with_annotations(options = {})
begin
if partial_path = options[:partial]
allocated_objects_before = ObjectSpace.allocated_objects
%{\n<!-- START PARTIAL: "#{partial_path}" -->\n#{render_partial_without_annotations(options)}\n<!-- #{ObjectSpace.allocated_objects - allocated_objects_before} objects allocated END PARTIAL: "#{partial_path}" -->\n}
else