- Thomas Wilburn
- News Developer at the Seattle Times
- @thomaswilburn on Twitter, GitHub
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 bash | |
#Crash on any failed command | |
set -e | |
dir=`dirname $0` | |
# the domains directory should contain one config file per domain | |
# each file contains a list of subdomains | |
# for example, here's domains/thomaswilburn.net: | |
# thomaswilburn.net | |
# www.thomaswilburn.net |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
# This sets the VM that we want to use - in this case, a classic Ubuntu 12.01 box | |
config.vm.box = "hashicorp/precise32" | |
# This makes the VM available in your browser on port 8080, and on MySQL's default port | |
config.vm.network "forwarded_port", guest: 80, host: 1234 #HTTP | |
#config.vm.network "forwarded_port", guest: 3306, host: 3306 #MySQL |
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 causes any elements with scroll-class attributes to add be updated either when they | |
reach the halfway point of the window, or when a target element (matching the selector in | |
the scroll-trigger attribute) reaches that point. For example: | |
<div class="example" scroll-class="activated" scroll-trigger=".trigger"> | |
This element will gain the "activated" class when the following element scrolls halfway: | |
<span class="trigger">TRIGGER ELEMENT</span> | |
</div> |
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
var r = require("./verboseRegex.js"); | |
var regex = r` | |
^ # from the start of the string | |
\s* # with any number of spaces | |
\(\s+ # find the first paren, followed by whitespace | |
([^)]+) # capture anything that's not a closing paren | |
\s*\) # followed by whitespace and a closing paren | |
`; |
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
var F = function(self) { | |
//being called from the shim | |
if (self) { | |
HTMLElement.call(self); | |
return self; | |
} | |
//must be native, use Reflect.construct() to perform super() | |
//this code is untested, came from rniwa | |
return Reflect.construct(HTMLElement, [], F); | |
}; |
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 is the main web handler, and uses the lock service | |
var sheetID = "xxxx"; | |
var rowConfig = "timestamp name location favorite note lifespan season contact lat lng city zone approve feature".split(" "); | |
/*** | |
Requests may come in with the following parameters: | |
name |
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
// Built-in modules | |
var csv = require("csv"); | |
var fs = require("fs"); | |
var url = require("url"); | |
// Loaded from NPM | |
var $ = require("cheerio"); // jQuery-like DOM library | |
var async = require("async"); // Easier concurrency utils | |
var request = require("request"); // Make HTTP requests simply |
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
define(async function() { | |
console.log("a loaded"); | |
var b = await require("b.js"); | |
return { a: true, b }; | |
}); |
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
var minimist = require("minimist"); | |
var sax = require("sax"); | |
var fs = require("fs"); | |
var args = minimist(process.argv); | |
var input = fs.createReadStream(args.i); | |
var parser = sax.createStream(); |