These commands are good as of 2011-07-27.
App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.
| C:\installs\trunk3_installed>cd bin | |
| C:\installs\trunk3_installed\bin>rake -T | |
| C:/installs/trunk3_installed/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find executable rake for rake-0.8.7 (Gem::Exception) | |
| from C:/installs/trunk3_installed/bin/rake:19:in `<main>' | |
| C:\installs\trunk3_installed\bin>cd .. | |
| C:\installs\trunk3_installed>cat ./lib/ruby/gems/1.9.1/specifications/rake.gemspec | |
| Gem::Specification.new do |s| |
| around_filter :set_time_zone | |
| def set_time_zone | |
| old_time_zone = Time.zone | |
| Time.zone = current_user.time_zone if logged_in? | |
| yield | |
| ensure | |
| Time.zone = old_time_zone | |
| end |
| via: http://groups.google.com/group/phillycocoa/browse_thread/thread/2d05f3eac5a7d260?hl=en | |
| revert file: | |
| git checkout HEAD path/to/file | |
| OR | |
| git checkout filename | |
| pluck one file from another branch | |
| git checkout Branch path/to/file |
| @implementation MySharedThing | |
| + (id)sharedInstance | |
| { | |
| DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
| return [[self alloc] init]; | |
| }); | |
| } | |
| @end |
These commands are good as of 2011-07-27.
App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.
| I wish code completion would work inside of STAssert* | |
| I wish the console output would show number of asserts in addition to: | |
| Executed 59 tests, with 0 failures (0 unexpected) in 0.999 (1.082) seconds | |
| I wish the console would always be scrolled to the bottom and the current output (more of a general Xcode bug though). | |
| I wish I didn't have to add a string to the end of every assert. |
| - (void)loadDefaultSettings | |
| { | |
| NSMutableDictionary *defaults = [NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default-Settings" ofType:@"plist"]]; | |
| // other setup... | |
| [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithDictionary:defaults]]; | |
| } | |
| - (void)resetDefaultSettings |
| // [image writeToFile:[NSURL fileURLWithPath:@"/some/path/image.png"]]; | |
| - (void)writeToFile:(NSURL *)fileURL | |
| { | |
| NSBitmapImageRep *bitmapRep = nil; | |
| for (NSImageRep *imageRep in [self representations]) | |
| { | |
| if ([imageRep isKindOfClass:[NSBitmapImageRep class]]) | |
| { | |
| bitmapRep = (NSBitmapImageRep *)imageRep; |
| def hidden_div_if(condition, attributes = {}, &block) | |
| if condition | |
| attributes["style"] = "display: none" | |
| end | |
| content_tag("div", attributes, &block) end | |
| end |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |