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
// Example: | |
// | |
// Widont makes the last space non-breaking | |
// so you don't end up with one word on its | |
// own. | |
// | |
// Widont makes the last space non-breaking | |
// so you don't end up with one word on | |
// its own. | |
// |
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
/** | |
Allows easier pushing and popping of clang warnings. | |
Example (Ignoring undeclared selectors): | |
SQClangDiagnosticPushIgnored(-Wundeclared-selector); | |
SEL undeclaredSelector = @selector(thisSelectorDoesNotExist:::); | |
SQClangDiagnosticPop; | |
*/ |
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
//#if os(OSX) | |
import Cocoa | |
struct NSRectCorner : RawOptionSet { | |
var value: UInt = 0 | |
init(_ value: UInt) { self.value = value } | |
func toRaw() -> UInt { return self.value } | |
func getLogicValue() -> Bool { return self.value != 0 } | |
static func fromRaw(raw: UInt) -> NSRectCorner? { return self(raw) } | |
static func fromMask(raw: UInt) -> NSRectCorner { return self(raw) } | |
static func convertFromNilLiteral() -> NSRectCorner { return self(0) } |
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
// | |
// SSMapAnnotation.h | |
// Public Domain | |
// | |
// Created by Sam Soffes on 3/22/10. | |
// Copyright 2010 Sam Soffes. All rights reserved. | |
// | |
#import <MapKit/MapKit.h> |
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
// keyTimes = array floats for second [(NSNumber)1.2,(NSNumber)2.0] == 2 frames, 1.2 secs for first frame, 2.0 seconds for second frame | |
- (void) addDiscreteTimedImageAnimation:(NSString *)animationName view:(UIImageView *)imageView images:(NSArray *)images keyTimes:(NSArray *)keyTimes repeatCount:(float)repeatCount onDone:(SEL)callback { | |
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"]; | |
NSMutableArray *values = [[NSMutableArray alloc] initWithCapacity:[images count]]; | |
NSMutableArray *keyTimesAsPercent = [[NSMutableArray alloc] initWithCapacity:[keyTimes count]]; | |
double totalDuration = 0.0; | |
for(UIImage *image in images) { | |
[values addObject:(id)(image.CGImage)]; | |
} |
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 'rake/tasklib' | |
TARGET_NAME = "libLROAuth2Client" | |
module XcodeBuild | |
class TaskBuilder < Rake::TaskLib | |
attr_accessor :target, :configuration | |
def initialize(name) | |
@name = name |
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
#!/usr/bin/env ruby | |
file = STDIN.read[/sass: ([^*]+\.scss)/, 1] || ENV["TM_FILEPATH"] | |
file2 = file.sub(/\.scss/,'.css') | |
system("sass \"#{file}\":\"#{file2}\"") |
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
//Throw this on your UITableViewDelegate (probably your UITableViewController) to achieve the "keyboard dismisses when I tap away" effect. | |
//Your users will thank you. A lot. | |
- (void) scrollViewWillBeginDragging:(UIScrollView *)scrollView { | |
[self.view endEditing:YES]; | |
} | |
//The endEditing: method on UIView comes to us from a category that UITextField adds to UIKit that makes the view or any subview that is the first responder resign (optionally force), that's what the "YES" bit is. |
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
namespace :deploy do | |
desc "Make sure there is something to deploy" | |
task :check_revision, :roles => :web do | |
unless `git rev-parse HEAD` == `git rev-parse origin/master` | |
puts "WARNING: HEAD is not the same as origin/master" | |
puts "Run `git push` to sync changes." | |
exit | |
end | |
end | |
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
gem 'sass-rails', :git => 'https://github.com/rails/sass-rails.git', :ref => '031236b31eaf20658226a9ae051749cc6647c33f' | |
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :ref => '2c1fcfcad708875d10db65740aabf417abc636a6' | |
gem 'sprockets', '2.0.0.beta.10' |
OlderNewer