Skip to content

Instantly share code, notes, and snippets.

View tylor's full-sized avatar

Tylor Sherman tylor

View GitHub Profile
@tylor
tylor / allcaps.html
Created October 22, 2012 22:48
Does this hurt?
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
@tylor
tylor / pg-aws-backups.md
Created November 7, 2012 22:55
Weekly backups of PostgreSQL database to Amazon S3

Weekly backups of PostgreSQL database to Amazon S3

  1. I did this as root: $ sudo su, although it may not be necessary.
  2. Download AWS command line tools: $ curl https://raw.github.com/timkay/aws/master/aws -o aws
  3. Install:
    • Automatically: $ perl --install aws
    • Manually: $ mv aws /usr/local/bin/ && chmod +x /usr/local/bin/aws
@tylor
tylor / tracecircle.js
Created November 13, 2012 07:12
Generate CSS3 transform animation that traces a circle
#!/usr/bin/env node
/**
* Generate CSS3 transform animation that traces a circle.
*
* $ node tracecircle.js animationName vendorPrefix percentStep radiusPixels
*
* For example:
*
* $ node tracecircle.js floating -webkit- 10 20
@tylor
tylor / Procfile
Created December 7, 2012 20:29
Quick node.js HTTP proxy on Heroku
web: node index.js
@tylor
tylor / tweet-counts.js
Created December 16, 2012 23:07
Scan your Twitter archive to get a basic count of the people you've talked to and the words that you've used.
/*
* Scan your official Twitter archive to get a basic count of the
* people you've talked to and the words that you've used.
*
* $ node tweet-counts.js ~/path/to/tweets-archive/
*
*/
var fs = require('fs');
var base = process.argv[2].replace(/\/$/, ''); // Strip trailing slash.
var Grailbird = { data: {} }; // The Twitter archive uses this.
@tylor
tylor / gist:4708786
Created February 4, 2013 19:06
Sort by column in simple CSV (eg. BC Hydro usage)
cat input.csv | sort -t ',' -k3
@tylor
tylor / gist:5475887
Last active December 16, 2015 18:09
Old assembly program
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
@tylor
tylor / index.js
Created May 1, 2013 07:44
Convert GPS tagged images to CSV for graphing on a map
/**
* 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:
@tylor
tylor / Procfile
Last active December 17, 2015 20:19
Add CORS headers to an API endpoint.
web: node index.js
@tylor
tylor / package.json
Created March 2, 2014 05:11
Scrape the CrossFit Open 2014 Results and create a CSV
{
"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"
}
}