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
dmzpound:/var/lib/dpkg# apt-get upgrade | |
Reading package lists... Done | |
Building dependency tree... Done | |
The following NEW packages will be installed: | |
zlib1g | |
The following packages will be upgraded: | |
libbz2-1.0 libc6 libgcrypt11 libgnutls13 libgpg-error0 liblzo1 libncursesw5 libopencdk8 libtasn1-3 lynx tzdata | |
11 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. | |
11 not fully installed or removed. | |
Need to get 8213kB of archives. |
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
NSSortDescriptor *sortByDate = [[NSSortDescriptor alloc] initWithKey:@"self" ascending:NO]; | |
NSArray *sortingDescriptors = [NSArray arrayWithObject:sortByDate]; | |
[sortByDate release]; | |
// sort array and save for later | |
alertDates = [[tempDates sortedArrayUsingDescriptors:sortingDescriptors] retain]; |
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
+ (void)clearCaches { | |
// clear any URL caches | |
[[NSURLCache sharedURLCache] removeAllCachedResponses]; | |
// clear any cookie caches | |
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; | |
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://%@/", kAPIHost]]; | |
for (NSHTTPCookie *cookie in [cookieStorage cookiesForURL:url]) { | |
[cookieStorage deleteCookie:cookie]; | |
} |
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
require 'zlib' | |
class String | |
def gzip | |
io = StringIO.new | |
gz = Zlib::GzipWriter.new(io) | |
gz.write(self) | |
gz.close | |
io.string | |
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
class ExternalDbModel < ActiveRecord::Base | |
self.abstract_class = true | |
establish_connection "external_#{RAILS_ENV}" | |
# only need this if you want the other db to be readonly | |
#private | |
# def after_initialize | |
# readonly! | |
# 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
NSDictionary *fadeOutDict = [NSDictionary dictionaryWithObjectsAndKeys:_mainFeedViewController.view, NSViewAnimationTargetKey, NSViewAnimationFadeOutEffect, NSViewAnimationEffectKey, nil]; | |
NSAnimation *animation = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObjects:fadeOutDict, nil]]; | |
[animation setDelegate:self]; | |
[animation setFrameRate:60.0]; | |
[animation setDuration:0.5f]; | |
[animation setAnimationBlockingMode:NSAnimationBlocking]; | |
[animation setAnimationCurve:NSAnimationEaseIn]; | |
[animation startAnimation]; | |
[animation release]; |
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
// Using an animation grouping because we may be changing the duration | |
[NSAnimationContext beginGrouping]; | |
// With the shift key down, do slow-mo animation | |
if ([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask) { | |
[[NSAnimationContext currentContext] setDuration:1.0]; | |
} else { | |
[[NSAnimationContext currentContext] setDuration:0.6]; | |
} | |
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
[14:32:48]~/Code/cardiomems/clarity/champion[master*]$ ./script/console | |
Loading development environment (Rails 2.3.12) | |
config.load_paths is deprecated and removed in Rails 3, please use autoload_paths instead | |
config.load_paths= is deprecated and removed in Rails 3, please use autoload_paths= instead | |
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. | |
Gem.source_index called from /Users/veader/.rvm/gems/ruby-1.8.7-p352@championhf/gems/rails-2.3.12/lib/rails/gem_dependency.rb:21. | |
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01. | |
Gem::SourceIndex#initialize called from /Users/veader/.rvm/gems/ruby-1.8.7-p352@championhf/gems/rails-2.3.12/lib/rails/vendor_gem_source_index.rb:100. | |
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. | |
Gem::SourceIndex#add_spec called from /Users/veader/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems |
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
context 'Benchmarking' do | |
setup do | |
100000.times { |i| Artist.make! } | |
end | |
should 'do lots of work' do | |
require 'benchmark' | |
Benchmark.bm do |x| | |
x.report { Artist.random } | |
x.report { Artist.random(5) } |
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
========================================================================================== | |
ORIGINAL CODE | |
$ ruby test/test_randumb.rb | |
Loaded suite test/test_randumb | |
Started | |
........ user system total real | |
2.920000 0.070000 2.990000 ( 3.092471) | |
2.990000 0.070000 3.060000 ( 3.069336) | |
2.970000 0.070000 3.040000 ( 3.070131) |
OlderNewer