Skip to content

Instantly share code, notes, and snippets.

View thomaswilburn's full-sized avatar
🦝

Thomas Wilburn thomaswilburn

🦝
View GitHub Profile
var request = require("request"),
fs = require("fs"),
cheerio = require("cheerio"),
json2csv = require("json2csv"),
url = "https://www.wilkescc.edu/about-us/directory/?letter=";
var alpha = "abcdefghijklmnopqrstuvwxyz".toUpperCase().split("");
var all_emails = [],
first_names = [],
@thomaswilburn
thomaswilburn / svg-vanilla.html
Last active November 30, 2017 21:43
SVG demo pages
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Generating SVG from vanilla JS</title>
</head>
<body>
<svg class="target-element"></svg>
<script>
@thomaswilburn
thomaswilburn / forth.js
Created November 2, 2017 16:27
Terrible Forth in JS
var testScript = `
[ double dup + ]
[ quadruple double double ]
1 2 + print
double print
quadruple print
2 jmp
3 +
4 +
if 255 print 0 then
@thomaswilburn
thomaswilburn / groovy.html
Last active September 12, 2017 05:44
Lava lamp metaballs
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Groovy</title>
</head>
<body>
<canvas></canvas>
<style>
canvas {
@thomaswilburn
thomaswilburn / voronoi.html
Last active September 9, 2017 03:00
Voronoi diagram in WebGL
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Voronoi</title>
</head>
<body>
<canvas class="voronoi"></canvas>
<style>
canvas {
@thomaswilburn
thomaswilburn / csv.js
Created June 24, 2017 00:46
Minimal CSV module
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, ""));
}
@thomaswilburn
thomaswilburn / index.js
Created June 22, 2017 18:17
Archive that blogspot feed that you really like
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");
@thomaswilburn
thomaswilburn / index.js
Created April 26, 2017 23:22
Methode to Markdown
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();
@thomaswilburn
thomaswilburn / a.js
Last active March 10, 2017 00:30
AMD promises
define(async function() {
console.log("a loaded");
var b = await require("b.js");
return { a: true, b };
});
@thomaswilburn
thomaswilburn / index.js
Last active July 22, 2017 21:23
ASP page scraper with comments
// 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