I hereby claim:
- I am crayment on github.
- I am crayment (https://keybase.io/crayment) on keybase.
- I have a public key whose fingerprint is AFD0 1E3D 1219 DD40 055E FF54 6D0A 8F14 ED43 F4BC
To claim this, I am signing this object:
assert_have_xpath("//table[@id='items']/tr[@id='item_row_#{id}' and position()=#{position}]") |
def ask message, answer = /.*/, add_options_string = answer == /.*/ ? false : true | |
message = message + ' (' + answer.source + ')' if add_options_string | |
begin | |
print message | |
input = STDIN.gets.chomp | |
end while input !~ /^#{answer}$/ | |
input | |
end | |
class CheckoutsController < ApplicationController | |
def index | |
@categories = Category.all | |
end | |
end |
NSDictionary *dictionary; | |
NSArray *words = [dictionary allKeys]; | |
NSMutableString *javascript = @"addText("; | |
for (int i=0; i<[words count]; i++) { | |
[javascript appendString:@"%@", [words objectAtIndex:i]]; | |
if(i<([words count]-1)) { | |
[javascript appendString:@", "]; | |
} | |
} |
SocketIOClient *socket = [SocketIOClient socketIOClientWithHost:@"www.marcelball.ca" port:8000 delegate:self]; | |
NSDictionary *message = [NSDictionary | |
dictionaryWithObjects: | |
[NSArray arrayWithObjects: | |
@"handshake", | |
@"[email protected]", | |
@"a", | |
@"false", nil] | |
forKeys:[NSArray arrayWithObjects: | |
@"action", |
I hereby claim:
To claim this, I am signing this object:
/// Custom type for the error case which includes a value. Here I end up using JSON but you could easily decode to a model on error. | |
struct MyNetworkError<T> { | |
let response: Response<NSData, NSError>? | |
let error: ErrorType | |
let value: T? | |
var statusCode: HTTPStatusCode? { | |
guard let response = response?.response else { return nil } | |
return HTTPStatusCode(intValue: response.statusCode) | |
} |
struct MasterResponse<T: JSONDecodable> { | |
let object: T? | |
let error: [String: JSON]? | |
} | |
extension MasterResponse: JSONDecodable { | |
init(json: JSON) throws { | |
guard case let .Dictionary(jsonDictionary) = json else { | |
let error = JSON.Error.ValueNotConvertible(value: json, to: MasterResponse.self) | |
throw error |
import ObjectiveC | |
import UIKit | |
// MARK: - AutoScrollView | |
/** | |
A scroll view that automatically scrolls to first responders when the keyboard is shown. | |
Supports the `focusView` and `focusPadding` properties of the first responder if it conforms to `KeyboardAdjustingResponder` | |
Vertical scrolling support only. | |
*/ |
import Foundation | |
/** | |
Observable wraps an internal value providing a simple API for consumers to be notified of changes to the value. | |
You add an observation by specifying an `observer` which should be thought of as a lifetime object. When the `observer` | |
is deallocated the observation is removed and the closure will not be called again. It is possible to unsubscribe | |
earlier by passing the `observer` to `removeObserver(_:)`. Note though that this removes all observations added using | |
this `observer`. | |