I hereby claim:
- I am thinkclay on github.
- I am unicorn (https://keybase.io/unicorn) on keybase.
- I have a public key whose fingerprint is EAE4 4A12 A705 9427 1413 2E74 0F75 CB27 7787 5FA5
To claim this, I am signing this object:
| // As an example, let's look at a reduction that creates a total sum | |
| // of an array of Floats with a different approaches, all with the same outcome: | |
| let total: [Float] -> Float = { $0.reduce(0, combine: +) } | |
| let total = transactions.reduce(0, {$0 + $1}) | |
| // It's easy to swap out operators to make it a multiplication, division, | |
| // or some other custom block execution. | |
| // Here we want to know if an entire list of booleans is true: |
| // Throws errors | |
| let immutableString = "Clay is" | |
| immutableString += " awesome" | |
| // Works | |
| var mutableString = "Clay is" | |
| mutableString += " a big nerd" |
| // foo is automatically set to the `String` type | |
| let foo = "Hello" |
| @IBAction func submitTapped(sender: AnyObject) { | |
| validator.validateFieldByKey(Fields[0], delegate:self) | |
| validator.validateFieldByKey(Fields[1], delegate:self) | |
| } |
| import Security | |
| public class Keychain | |
| { | |
| public class func set(key: String, value: String) -> Bool | |
| { | |
| if let data = value.dataUsingEncoding(NSUTF8StringEncoding) | |
| { | |
| return set(key, value: data) | |
| } |
| import UIKit | |
| class ViewController: UIViewController { | |
| @IBOutlet weak var buttonWithBorderLeft: UIButton! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view, typically from a nib. | |
I hereby claim:
To claim this, I am signing this object:
| const Input = (props) => { | |
| const onFocus = (e) => { | |
| let input = e.target | |
| if (input.hasAttribute('readonly')) | |
| { | |
| input.removeAttribute('readonly') | |
| input.blur() | |
| input.focus() | |
| } |
I hereby claim:
To claim this, I am signing this object:
| # config/initializers/mailer_injection.rb | |
| # This allows `request` to be accessed from ActionMailer Previews | |
| # And @request to be accessed from rendered view templates | |
| # Easy to inject any other variables like current_user here as well | |
| module MailerInjection | |
| def inject(hash) | |
| hash.keys.each do |key| | |
| define_method key.to_sym do |