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
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(); |
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 async = require("async"); | |
var cheerio = require("cheerio"); | |
var FeedParser = require("feedparser"); | |
var request = require("request"); | |
var shell = require("shelljs"); | |
var fs = require("fs"); | |
var path = require("path"); | |
var url = require("url"); | |
var zlib = require("zlib"); |
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 isNumber = /^-?\d[\d.,]*$/; | |
var cast = function(str) { | |
if (typeof str != "string") return str; | |
if (str == "true" || str == "false") { | |
return str == "true" ? true : false; | |
} | |
if (isNumber.test(str)) { | |
return parseFloat(str.replace(/,/g, "")); | |
} |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Voronoi</title> | |
</head> | |
<body> | |
<canvas class="voronoi"></canvas> | |
<style> | |
canvas { |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Groovy</title> | |
</head> | |
<body> | |
<canvas></canvas> | |
<style> | |
canvas { |
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
/* | |
We're going to start by adding a canvas to the page and getting a context for it. | |
*/ | |
var canvas = document.createElement("canvas"); | |
canvas.width = canvas.height = 320; | |
document.body.appendChild(canvas); | |
var gl = canvas.getContext("experimental-webgl"); | |
/* | |
WebGL doesn't know how to draw anything onscreen out of the box. We have to |