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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
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
function isRequired(param) { | |
throw new Error(`Missing param "${param}" is required.`) | |
} | |
function myFunc( | |
{ | |
optionalParam, | |
paramWithDefaultVaue = 'my default value', | |
requiredParam = isRequired('requiredParam'), | |
} = {} |
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
<head> | |
<title>%PAGE_TITLE%</title> | |
<meta name="title" content="%PAGE_TITLE%"> | |
<meta name="description" content="%DESCRIPTION%"> | |
<meta property="fb:app_id" content="%FACEBOOK_APP_ID%"> | |
<meta name="twitter:card" content="summary_large_image"> |
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
// Add this to viewDidLoad() | |
NSNotificationCenter.defaultCenter().addObserver(self, | |
selector: "keyboardShown:", name: UIKeyboardDidShowNotification, object: nil) | |
// This function handles notification | |
func keyboardShown(notification: NSNotification) { | |
let info = notification.userInfo! | |
let value: AnyObject = info[UIKeyboardFrameEndUserInfoKey]! | |
let rawFrame = value.CGRectValue() |