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
// Port of Rails word_wrap(): https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/text_helper.rb#L260 | |
// rstrip using: https://stackoverflow.com/a/1418059 | |
const word_wrap = (text, line_width, break_sequence) => { | |
line_width = line_width || 80 | |
break_sequence = break_sequence || "\n" | |
return text.split("\n").map((line) => { | |
return line.length > line_width ? line.replace(new RegExp(`(.{1,${line_width}})(\\s+|$)`, 'gm'), `$1${break_sequence}`).replace(/^\s+|\s+$/g, '') : line | |
}).join("\n") | |
} |
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 tylor on github. | |
* I am tylorsherman (https://keybase.io/tylorsherman) on keybase. | |
* I have a public key ASCzt3oU8N8wUbRji-ONxVuvuHS0Ox2x48oqm5kNnnOSAwo | |
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
/** | |
* Handy commands for setting everything up: | |
* | |
* Get Particle access token: | |
* $ curl https://api.particle.io/oauth/token -u particle:particle -d grant_type=password -d username={Your Particle email address} -d password={Your Particle password} | |
* | |
* Get list of devices from Particle: | |
* $ curl "https://api.particle.io/v1/devices?access_token={Your Particle access token}" | |
* |
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
I always forget I'm signed in with my personal GMail account, and want | |
to access our businesses Google Analytics, so here's what happens: | |
1. Load up http://www.google.com/analytics/ | |
2. Click 'Access Google Analytics' | |
3. Woops, wrong account. Click 'Sign out' | |
4. Choose business account | |
5. Enter password | |
6. Takes me to 'Personal Info - Account Settings' | |
7. Load up http://www.google.com/analytics/ |
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
VAN=`egrep -i "^...$" /usr/share/dict/words | perl -MList::Util=shuffle -e "print shuffle<STDIN>" | head -n 1 | tr "[:lower:]" "[:upper:]"` && \ | |
LETTER=${VAN:1:1} && \ | |
EAST=`egrep -i "^.${LETTER}..$" /usr/share/dict/words | perl -MList::Util=shuffle -e "print shuffle<STDIN>" | head -n 1 | tr "[:lower:]" "[:upper:]"` && \ | |
echo " ${EAST:0:1}" && \ | |
echo $VAN && \ | |
echo " ${EAST:2:1}" && \ | |
echo " ${EAST:3:1}" |
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
{ | |
"name": "xf-games-open-14-scrape", | |
"version": "0.0.0", | |
"license": "MIT", | |
"dependencies": { | |
"request": "~2.34.0", | |
"cheerio": "~0.13.1", | |
"async": "~0.2.10" | |
} | |
} |
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
web: node index.js |
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
/** | |
* This script takes a directory of images, looks for GPS | |
* coordinates in each file, and then writes the filename and | |
* decimal degrees to CSV. If you're pulling images off of your | |
* iPhone, using Image Capture is a quick way to move them onto | |
* your computer and get started. | |
* | |
* Make sure you have imagemagick installed: | |
* $ brew install imagemagick | |
* Download these files and install dependencies: |
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
0AEA:0100 mov cx,0 # move 0 into CX | |
0AEA:0103 mov ah,1 # move 1 into AH | |
0AEA:0105 int 21 # interrupt: read character (AH=1), drop in AL | |
0AEA:0107 push ax # push AX (AH, AL) onto stack | |
0AEA:0108 inc cx # increment CX | |
0AEA:0109 cmp al,20 # compare AL with 0x20 (space character) | |
0AEA:010B jnz 105 # jump if not zero to 0105 | |
0AEA:010D pop dx # pop stack into DX | |
0AEA:010E sub dx,20 # subtract 0x20 from DX (making characters uppercase) | |
0AEA:0111 mov ah,2 # mov 2 into AH |
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
cat input.csv | sort -t ',' -k3 |
NewerOlder