Skip to content

Instantly share code, notes, and snippets.

View joecannatti's full-sized avatar

Joe Cannatti joecannatti

View GitHub Profile
@joecannatti
joecannatti / lisp.rb
Created September 2, 2010 15:36 — forked from dahlia/lisp.rb
# 30 minutes Lisp in Ruby
# Hong MinHee <http://dahlia.kr/>
#
# This Lisp implementation does not provide a s-expression reader.
# Instead, it uses Ruby syntax like following code:
#
# [:def, :factorial,
# [:lambda, [:n],
# [:if, [:"=", :n, 1],
# 1,
@joecannatti
joecannatti / tag.m
Created November 2, 2010 16:39
tag property demo
-(void)someSituation{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
alert.tag = 0;
[alert show];
[alert release];
}
-(void)someOtherSituation{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
#import "Kiwi.h"
#import "KoansIncludes.h"
SPEC_BEGIN(AboutValueAssertions)
describe(@"Value Assertions", ^{
it(@"can assert truth", ^{
[[theValue(NO) should] beTrue];
});
#!/bin/sh
./run_tests.rb "/Developer/usr/bin/xcodebuild -target SWPresentationKit -configuration Debug -sdk iphonesimulator4.2"
function! RedGreenForShellCmd(cmd)
exec ":! " . a:cmd
redraw
if v:shell_error
call RedBar()
else
call GreenBar()
endif
endfunction
:map <Leader>t :call RedGreenForShellCmd('./run_store_tests.sh') <CR>
#!/usr/bin/ruby
require 'rubygems'
require 'colorize'
$stdout.print "Building"
$stdout.flush
$errcode = 0
show_output = false
puts
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>1 1 1 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 1 1 1</string>
for i in *.png; do j=`echo $i | sed 's/^\(Plate_\([0-9]*\).*\)/\2/g'`; cp "$i" "renamed/$j.png"; done
@joecannatti
joecannatti / rename.sh
Created March 28, 2011 22:21
Rails method rename
for i in `find . -name \*.rb`; do echo $i; sed -i -e "/[:.]omc_data_service/ s/\([:.]\)omc_data_service/\1service/g" $i; done