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
// 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
const exportedGoogleContacts = [...] | |
const updatedContacts = jonsContacts.map(contact => { | |
let modifiedContact = {} | |
Object.keys(contact).forEach(key => { | |
const value = contact[key] | |
if (!value) { | |
return | |
} else if (String(value).length > 10 && String(value).replace(/[^0-9\+]/g, '').length >= 10 && value.length < 20) { | |
const formattedPhone = formatNumber(value); |
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
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
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
// Fetch NSDictionary containing possible saved state | |
NSString *errorDesc = nil; | |
NSPropertyListFormat format; | |
NSString *plistPath; | |
NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, | |
NSUserDomainMask, YES) objectAtIndex:0]; | |
plistPath = [rootPath stringByAppendingPathComponent:@"SavedState.plist"]; | |
NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath]; | |
NSDictionary *unarchivedData = (NSDictionary *)[NSPropertyListSerialization | |
propertyListFromData:plistXML |
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 `~/bin` to the `$PATH` | |
export PATH="$HOME/bin:$PATH" | |
# Python 3.5 packages | |
export PATH="$PATH:~/Library/Python/3.5/bin" | |
# Sublime Text - http://stackoverflow.com/a/16495202 | |
export EDITOR='subl -w' | |
# Load the shell dotfiles, and then some: |
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 | |
# | |
# Jon Sibley, Sept 17 2013, based on this gist: https://gist.github.com/hakanensari/4194831 | |
# | |
# A minimal commit message hook that extracts a JIRA ticket number from the branch | |
# name and appends it to the commit message. | |
# | |
# The commit message remains unchanged if the branch name doesn't include a | |
# ticket number or the message already includes a reference to it. | |
# |
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
#!/bin/sh | |
# name this .git/hooks/pre-commit | |
# chmod +x .git/hooks/pre-commit | |
# enjoy | |
# so it will work on empty repos | |
if git-rev-parse --verify HEAD >/dev/null 2>&1; then | |
against=HEAD | |
else | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |
NewerOlder