Skip to content

Instantly share code, notes, and snippets.

View spotfleet-bad.template.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Builds an ECS Cluster",
"Parameters": {},
"Resources": {
"SpotFleet": {
"Type": "AWS::EC2::SpotFleet",
"Properties": {
"SpotFleetRequestConfigData": {
"AllocationStrategy": "diversified",
View spotfleet-good.template.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Builds an ECS Cluster",
"Parameters": {},
"Resources": {
"SpotFleet": {
"Type": "AWS::EC2::SpotFleet",
"Properties": {
"SpotFleetRequestConfigData": {
"AllocationStrategy": "diversified",
@yhahn
yhahn / index.js
Created Jul 31, 2015
murmur collision tests
View index.js
var fnvplus = require('fnv-plus');
var murmur = require('murmur');
function collisionRate(bits) {
var hashes = {};
var texts = 0;
var collisions = [];
var sample = 1e6;
console.time(bits + ' bits');
while (texts < sample) {
@yhahn
yhahn / index.js
Last active Aug 29, 2015
fnv-plus collision tests
View index.js
var fnvplus = require('fnv-plus');
function collisionRate(bits) {
var hashes = {};
var texts = 0;
var collisions = [];
var sample = 1e6;
while (texts < sample) {
var text = Math.random().toString(36);
var hash = fnvplus.hash(text,bits).hex();
@yhahn
yhahn / marker.png
Last active Aug 29, 2015
mapnik markersnapping testcase
@yhahn
yhahn / ami.js
Last active Aug 29, 2015
Get latest trusty AMIs
View ami.js
var https = require('https');
var body = '';
https.get('https://cloud-images.ubuntu.com/locator/ec2/releasesTable', function(res) {
res.on('data', function(chunk) { body += chunk; });
res.on('end', finish);
});
function finish() {
// Bad JSON -- has trailing comma.
@yhahn
yhahn / phrase-fnv1a32.txt
Last active Dec 27, 2015
carmen colllision tests
View phrase-fnv1a32.txt
{"hash":"1047421","terms":["callejon de rojas","carrer santo tomas"]}
{"hash":"2080597","terms":["melin street","zelk lane"]}
{"hash":"2177846","terms":["gansz lane","wandel drive"]}
{"hash":"2857275","terms":["cavendish drice","elm wk"]}
{"hash":"4382878","terms":["profesora stanislawa lojasiewicza","tegel close"]}
{"hash":"9876508","terms":["beyer close","vanyo road"]}
{"hash":"10287211","terms":["billy london road","rua julio braido"]}
{"hash":"10760203","terms":["international drive","paul schuster strasse"]}
{"hash":"12498122","terms":["borslungvegen","sand hallow road"]}
{"hash":"13664186","terms":["turnuey ridge road","valley fork drive"]}
@yhahn
yhahn / map.geojson
Created Aug 20, 2013
via:geojson.io
View map.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.