Skip to content

Instantly share code, notes, and snippets.

View erlenstar's full-sized avatar

Jeff Zerger erlenstar

  • Phykos, PBC
  • Pacifica, CA
View GitHub Profile
@springmeyer
springmeyer / README.md
Last active December 25, 2015 05:29
MapBox Cloudless Atlas Tour

Speakers notes

Part of a presenation given at NACIS 2013: https://github.com/springmeyer/cloudless-nacis2013

  • Bahamas - land really pops due to blurred shallow nearshore
  • Australia - rich hues
  • Great Barrier Reef - Extremely subtle textures visible + water mask helps show smallest reefs
  • Amur River - effectively shows many combined flood events / murky water in delta
  • Taiwan - deforestation clearly visible
  • Tibet - Jewel lakes
@erlenstar
erlenstar / .block
Created May 4, 2016 20:58 — forked from mbostock/.block
Nest Treemap
license: gpl-3.0
height: 1060
app.all('*', function (req, res, next) {
res.header("Access-Control-Allow-Origin", req.headers.origin);
res.header("Access-Control-Allow-Credentials", true);
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
res.header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Authorization, Content-Length");
if (req.method == 'OPTIONS') {
return res.send(200);
}

I18n with Records

Goals:

  1. Elm's typechecker enforces that
  • each localization has all the same messages.
  • the messages you are referring to in your view code exist.
  1. Only the localized strings for the current locale are sent across the wire
  2. Messages which have interpolations are typechecked as well
@jonobr1
jonobr1 / Superformula.js
Created February 23, 2012 17:00
@brysonian's Superformula in JavaScript
(function() {
var root = this;
var previousSuperformula = root.Superformula;
var NP = 360, phi = Math.PI * 2 / NP;
var Superformula = root.Superformula = function(m, n1, n2, n3) {
@blainerothrock
blainerothrock / gen.swift
Last active July 12, 2018 15:56
A Very Simple Genetic Algorithm Written in Swift 3
#!/usr/bin/env xcrun swift -O
/*
gen.swift is a direct port of cfdrake's helloevolve.py from Python 2.7 to Swift 3
-------------------- https://gist.github.com/cfdrake/973505 ---------------------
gen.swift implements a genetic algorithm that starts with a base
population of randomly generated strings, iterates over a certain number of
generations while implementing 'natural selection', and prints out the most fit
string.
The parameters of the simulation can be changed by modifying one of the many
function numerical_int(dx, y_array) {
var maxy = Math.max.apply(null, y_array);
var dy_array = y_array.map(function(num) {
return Math.abs(maxy - num);
});
var profile_integral = 0;
var n = dy_array.length;
for (i = 1; i < n; i++) {
var dy_init = dy_array[i - 1];
var dy_end = dy_array[i];
@dwtkns
dwtkns / README.md
Last active May 28, 2019 06:59
Sun and Earth

Experiments faking 3d rotation of a globe and sun in SVG. Illusion is helped by dynamic gradients, two nested orthographic projections, scaling the sun circle's radius based on distance from the 'camera', and toggling a clipping mask that makes the sun appear to move "behind" the earth.

Based on Mike Bostock's Solar Terminator and this past experiment.

This example stems from drafts of maps for Norway the Slow Way. Also see Mike's Pencil Sketch example.

@jasondavies
jasondavies / README.md
Last active June 13, 2019 23:16 — forked from mbostock/.block
Vertical Bullet Charts
@amilamanoj
amilamanoj / WebSocket Server
Created June 22, 2013 17:29
Secure WebSocket Server with Jetty 9
package org.amila.sample.websocket.server;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.util.resource.FileResource;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.websocket.server.WebSocketHandler;