Skip to content

Instantly share code, notes, and snippets.

View mmower's full-sized avatar
💭
Writing code

Matt Mower mmower

💭
Writing code
View GitHub Profile
// Define a category on NSObject for our delegate methods
@interface NSObject (ELLayerViewDelegate)
- (void)hexSelected:(ELLayerView *) column:(int)col row:(int)row;
@end
if( [delegate respondsToSelector:@selector(hexSelected:column:row:)] ) {
[delegate hexSelected:self column:selectedCol row:selectedRow];
}
/Users/matt/Projects/LucidMac/Elysium/src/ELLayerView.m:113: warning: no '-hexSelected:column:row:' method found
## Error (only appears in rspec)
Mysql::Error: Unknown column 'refname' in 'where clause': SELECT * FROM `device_profiles` WHERE (refname = 'pc') LIMIT 1
## Schema
t.string "refname", :limit => 16
## SQL
== Sinatra has taken the stage on port 4567 for development with backup by Rack::Handler::Mongrel
Background thread started
Making API call to backend
127.0.0.1 - - [05/Aug/2008 16:14:57] "GET /cache?media_id=aacc956f-aa73-4e90-9524-b336bea5efc1&type=streaming&format=flvplayer&width=640&height=480 HTTP/1.1" 200 8 0.0527
Tue Aug 05 16:14:57 +0100 2008: Read error: #<NoMethodError: undefined method `invoke' for nil:NilClass>
./lib/../vendor/sinatra/lib/sinatra.rb:1049:in `lookup'
./lib/../vendor/sinatra/lib/sinatra.rb:1215:in `dispatch'
./lib/../vendor/rack/lib/rack/commonlogger.rb:20:in `call'
./lib/../vendor/rack/lib/rack/commonlogger.rb:20:in `_call'
./lib/../vendor/rack/lib/rack/commonlogger.rb:13:in `call'
Siona:~/Projects/reeplay.it/mproxy matt$ cap -v staging deploy
** transaction: start
** [65.74.139.2 :: out] D vendor/rack
** D vendor/sinatra
*** [err :: 65.74.139.2:8204] find: `/data/mproxy/releases/20080806092531/public/images': No such file or directory
*** [err :: 65.74.139.2:8204] find: `/data/mproxy/releases/20080806092531/public/stylesheets': No such file or directory
*** [err :: 65.74.139.2:8204] find: `/data/mproxy/releases/20080806092531/public/javascripts': No such file or directory
** transaction: commit
*** [err :: 65.74.139.2:8204] sudo:
*** [err :: 65.74.139.2:8204] /data/mproxy/current/script/process/reaper: command not found
## Recipe
task :stop, :roles => :app do
run "cd #{current_path} && #{try_runner} if [ -f tmp/mproxy.pid ]; then kill `echo tmp/mproxy.pid`; fi"
end
## Output
* executing `deploy:stop'
* executing "cd /data/mproxy/current && sudo -p 'sudo password: ' -u comi if [ -f tmp/mproxy.pid ]; then kill `echo tmp/mproxy.pid`; fi"
* executing "git clone -q --depth 1 git@mproxy-github:reeplayit/mproxy.git /data/mproxy/releases/20080806102609 && cd /data/mproxy/releases/20080806102609 && git checkout -q -b deploy 493ea9f7821755d57dbf336dfd6da564b7d9616f && git submodule -q init && git submodule -q update && (echo 493ea9f7821755d57dbf336dfd6da564b7d9616f > /data/mproxy/releases/20080806102609/REVISION)"
servers: ["65.74.139.2"]
[65.74.139.2:8204] executing command
** [65.74.139.2 :: err] error: Trying to write ref REMOTE_HEAD with nonexistant object 493ea9f7821755d57dbf336dfd6da564b7d9616f
** [65.74.139.2 :: err] fatal: Cannot update the ref 'REMOTE_HEAD'.
** [65.74.139.2 :: err] Warning: Remote HEAD refers to nonexistent ref, unable to checkout.
** [65.74.139.2 :: err] fatal: git checkout: updating paths is incompatible with switching branches/forcing
** Did you intend to checkout '493ea9f7821755d57dbf336dfd6da564b7d9616f' which can not be resolved as commit?
command finished
* executing "cd /data/mproxy/current && sudo -p 'sudo password: ' -u comi bin/stop"
servers: ["65.74.139.2"]
[65.74.139.2:8204] executing command
command finished
* executing `deploy:start'
* executing "cd /data/mproxy/current && sudo -p 'sudo password: ' -u comi bin/start"
servers: ["65.74.139.2"]
[65.74.139.2:8204] executing command
def note_to_freq( note_num )
base_note_num = note_num - 69
440.0 * Math.exp( 0.057762265 * ( note_num - 69 ) )
end
>> def f(&b)
>> pp binding
>> pp b.binding
>> yield
>> end
=> nil
>> f { pp binding }
#<Binding:0x10b3f3c>
#<Binding:0x10b3230>
#<Binding:0x10b2510>
class WhyWeNeedProcs
def initialize
@multiplier = lambda { |n| n }
end
def multiply( m, &multiplier )
if block_given?
# Note the use of & in the method specification explicitly
# converts any block passed to the method into a proc assigned