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
TextField("Target Weight", text: $viewModel.inputWeight) | |
.keyboardType(.decimalPad) | |
.onChange(of: viewModel.inputWeight, perform: { value in | |
viewModel.inputWeight = value.filter { "01234567890.".contains($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
### Keybase proof | |
I hereby claim: | |
* I am afarnham on github. | |
* I am afarnham (https://keybase.io/afarnham) on keybase. | |
* I have a public key whose fingerprint is 96B3 8D77 96D4 F6D3 3081 881B 3C38 2A68 DF5B 32FE | |
To claim this, I am signing this object: |
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
import UIKit | |
protocol FooProtocol { | |
init() | |
func description() -> String | |
} | |
class Bar : FooProtocol { | |
required init() { |
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
MKCoordinateRegion region; | |
if ([locations count] > 0) { | |
CLLocation *firstLoc = [locations objectAtIndex:0]; | |
CLLocationCoordinate2D southWest = firstCoord.coordinate; | |
CLLocationCoordinate2D northEast = southWest; | |
for (CLLocation* loc in founds) { | |
southWest.latitude = MIN(southWest.latitude, loc.coordinate.latitude); | |
southWest.longitude = MIN(southWest.longitude, loc.coordinate.longitude); | |
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
//Find the process ID for your iPhone app, attach the debug to it and hit continue. When you reach the first break point | |
//set "more" to "NO". Hit continue and you will stop at the second break point. | |
//Taken from here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/10156-how-do-i-debug-app-launched-url.html | |
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { | |
BOOL more = YES; | |
while (more) { | |
[NSThread sleepForTimeInterval:1.0]; // Set break point on this line | |
} | |
//your read code goes here. Set a second break point where you want to break at | |
} |
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
#import <Foundation/Foundation.h> | |
@interface Square : NSObject { | |
NSNumber *width; | |
NSNumber *height; | |
CGPoint center; | |
} | |
- (id)initWithJSON:(NSDictionary *)jsonData; |
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 CounterMetric(Metric): | |
def values(self): | |
if self.virtual: | |
return True | |
if 'call' in self.options: | |
self._record(self.options['call']) | |
return self._snapshot() |
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
>> inq.choices = [1,2,3] | |
=> [1, 2, 3] | |
>> inq.save | |
=> true | |
>> inq.choices | |
=> "123" | |
>> |
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
uninitialized constant Merb::Rack::StreamWrapper | |
/data/merb/dp-site/current/bin/../gems/gems/merb-core-0.9.10/lib/merb-core/controller/merb_controller.rb:348:in `rack_response' | |
/data/merb/dp-site/current/bin/../gems/gems/merb-core-0.9.10/lib/merb-core/dispatch/dispatcher.rb:79:in `handle' | |
/data/merb/dp-site/current/bin/../gems/gems/merb-core-0.9.10/lib/merb-core/dispatch/dispatcher.rb:35:in `handle' | |
/data/merb/dp-site/current/bin/../gems/gems/merb-core-0.9.10/lib/merb-core/rack/application.rb:17:in `call' | |
/data/merb/dp-site/current/bin/../gems/gems/merb-core-0.9.10/lib/merb-core/rack/middleware/static.rb:26:in `call' | |
/data/merb/dp-site/current/bin/../gems/gems/merb-core-0.9.10/lib/merb-core/rack/handler/mongrel.rb:75:in `process' | |
/data/merb/dp-site/current/gems/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client' | |
/data/merb/dp-site/current/gems/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each' | |
/data/merb/dp-site/current/gems/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client' |
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 Group | |
include DataMapper::Resource | |
property :id, Integer, :serial => true | |
property :name, String, :length => 256 | |
has n, :states, :through => Resource | |
end | |
class State |
NewerOlder