View slack.js
if (req.responseText.indexOf('{') == 0) {
try {
eval('obj = '+req.responseText);
} catch (err) {
console.warn('unable to do anything with api rsp');
}
}
View e.js
var e = function(/* tag, attrs, text, children...*/ ) {
var args = [].slice.call(arguments);
var tag = args.shift() || 'div';
var atts = args.shift() || attrs;
var text = args.shift() || '';
var kids = args;
var el = document.createElement(tag);
Object.keys(atts).forEach(function(k) {
el.setAttribute(k, atts[k]);
View bench-buffer-change.js
const Benchmark = require('benchmark');
var bench = Benchmark({
fn : function(){
var a = new Buffer(1024);
}
});
console.log(String(bench.run()));
View trouble.rs
extern crate hyper;
extern crate flate2;
use hyper::Client;
use std::io::{BufRead, BufReader};
use flate2::read::GzDecoder;
fn main() {
let client = Client::new();
let res = client.get("https://aws-publicdatasets.s3.amazonaws.com/common-crawl/crawl-data/CC-MAIN-2015-40/segments/1443736672328.14/wat/CC-MAIN-20151001215752-00000-ip-10-137-6-227.ec2.internal.warc.wat.gz")
View guh.c
#include <gdal.h>
#include <gdal_alg.h>
#include <stdbool.h>
#include <stdint.h>
#include <math.h>
#include "raster_layer.h"
#include "raster_resample.h"
#include "util.h"
#include "error.h"
View gist:86836f85bb5c724421a2
611cd20 add map-1957
aa5404d resolve merge
1e4180d easing kinda
dc8ff5f years
2c53b79 oldmap on tha map
31782dc old map
8397d32 I think this will work
500e787 change the world
92e694b waypoint
395e5ca feedbak
View cryptor.js
// WILL SAD TAB CHROME IF YOU OPEN THE INSPECTOR
// LOL CRYPTO
var c1 = document.querySelector("canvas#video");
var c2 = document.querySelector("canvas#crypt");
var video = document.querySelector("video");
var plain = c1.getContext("2d");
var crypt = c2.getContext("2d");
var key;
View vector-clock.js
var Clock = function(id){
this.id = id;
this.clock = {};
this.clock[this.id] = 0;
};
Clock.prototype.get = function() { return data; };
Clock.prototype.update = function(data, send) {
View Makefile
all: boston-results.csv
schools.csv: download.py
python download.py > schools.csv
boston-schools.csv: schools.csv
csvgrep -c 1 -m boston schools.csv > boston-schools.csv
boston-schools.db: boston-schools.csv
python build-dataset.py # in practice will output a sqlite db called boston-schools.db
View gist:0bc74e96cf789947ae02
desc "build cropped heightmap"
task :build_srtm do |t|
# have to download the SRTM_W_250m.tif first from cgiar
system "gdalwarp ./db/initial/srtm/SRTM_W_250m.tif ./db/initial/srtm/cropped.tif -t_srs 'EPSG:102003' -cutline ./db/initial/shapes/shoreline/us.shp -crop_to_cutline"
end
desc "build cropped raster from heightmap"
task :build_raster do |t|
STDOUT.sync = true
(200401..200407).each do |t|