This file contains hidden or 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
| task :babygitter_report, :roles => :app do | |
| require '../vendor/plugins/babygitter/babygitter' | |
| BabyGitter::ReportGenerator.new.write_report | |
| end |
This file contains hidden or 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
| package quickcompare; | |
| public class Beta { | |
| public float[] baseline; | |
| public float[] security; | |
| public double[] dailyMovement(float[] series) { | |
| int i; | |
| double[] percentChange = new double[series.length]; | |
This file contains hidden or 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
| # A sometimes useful development utility | |
| class Nop < BlankSlate | |
| def self.null | |
| new {} | |
| end | |
| def self.void | |
| new {throw :skip} | |
| end |
This file contains hidden or 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
| var in_subnav = false; | |
| function nap (m) {var then = new Date(new Date().getTime() + m); while (new Date() < then) {}} | |
| $(document).ready(function() { | |
| $('#navigation .baseball').mouseenter( function() { | |
| $('#baseball-regions').attr('style', 'left:50px;'); | |
| }); | |
| $('#baseball-regions a:contains(\'Northeast\')').mouseenter( function() { | |
| $('#northeast-areas').attr('style', 'left:100px;'); | |
| $('#southeast-areas').attr('style', 'left:-500px;'); | |
| }); |
This file contains hidden or 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
| require 'http_require' | |
| require 'http://github.com/why/camping/raw/master/lib/camping.rb' | |
This file contains hidden or 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
| # a testing utility by Mike Harris | |
| class PersistantHash | |
| def [](k) | |
| f = File.dirname(__FILE__) + "/phash/#{k}" | |
| if File.exists?(f) | |
| File.open(f) { |x| Marshal.load(x) } | |
| else | |
| nil |
This file contains hidden or 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
| # to start at the beginning and walk through the revisions, use these links ------------------- | |
| #| | |
| class Slapper #| | |
| def slap #| | |
| before_slap #|----> | |
| puts "I just slapped something" | |
| end | |
| def before_slap | |
| end |
This file contains hidden or 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
| NSString *plist_path = [NSHomeDirectory() stringByAppendingPathComponent:@"audio_recording_number.plist"]; | |
| NSLog(@"plist path: %@", plist_path); | |
| NSLog(@"file exists: %i", [[NSFileManager defaultManager] fileExistsAtPath:plist_path]); | |
| if ([[NSFileManager defaultManager] fileExistsAtPath:plist_path]) { | |
| NSLog(@"found audio config file"); | |
| } else { | |
| NSLog(@"did not find audio config file"); | |
| audio_recording_number = [NSNumber numberWithInteger:0]; | |
| NSDictionary *audio_properties = [NSDictionary dictionaryWithObject:audio_recording_number forKey:@"number_of_recordings"]; |
This file contains hidden or 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
| NSArray *comments; | |
| @try { | |
| comments = [self allFromXMLData:res.body]; | |
| } | |
| @catch (NSRangeException *e) { | |
| comments = [NSArray array]; | |
| } | |
| @catch (NSException *e) { | |
| comments = [NSArray array]; | |
| } |
This file contains hidden or 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
| class CommentsController | |
| def index | |
| @comments = if params[:book_id] | |
| @scope_object = Book.find(params[:book_id]) | |
| @scope_object.comments | |
| elsif params[:article_id] | |
| @scope_object = Article.find(params[:article_id]) | |
| @scope_object.comments | |
| else | |
| Comment.all |
OlderNewer