This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef unsigned char byte; | |
#define Clamp255(a) (a>255 ? 255 : a) | |
+ (UIImage*) fromImage:(UIImage*)source toColourR:(int)colR g:(int)colG b:(int)colB { | |
// Thanks: http://brandontreb.com/image-manipulation-retrieving-and-updating-pixel-values-for-a-uiimage/ | |
CGContextRef ctx; | |
CGImageRef imageRef = [source CGImage]; | |
NSUInteger width = CGImageGetWidth(imageRef); | |
NSUInteger height = CGImageGetHeight(imageRef); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after "deploy:stop", "clockwork:stop" | |
after "deploy:start", "clockwork:start" | |
after "deploy:restart", "clockwork:restart" | |
namespace :clockwork do | |
desc "Stop clockwork" | |
task :stop, :roles => clockwork_roles, :on_error => :continue, :on_no_matching_servers => :continue do | |
run "if [ -d #{current_path} ] && [ -f #{pid_file} ]; then cd #{current_path} && kill -INT `cat #{pid | |
_file}` ; fi" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after "deploy:stop", "clockwork:stop" | |
after "deploy:start", "clockwork:start" | |
after "deploy:restart", "clockwork:restart" | |
set :clockwork_roles, :blabla | |
set :cw_log_file, "#{current_path}/log/clockwork.log" | |
set :cw_pid_file, "#{current_path}/tmp/pids/clockwork.pid" | |
set :rails_env, ENV['rails_env'] || '' | |
namespace :clockwork do |