Skip to content

Instantly share code, notes, and snippets.

@s2t2
s2t2 / .block
Created March 18, 2017 06:38 — forked from mbostock/.block
Every ColorBrewer Scale
license: gpl-3.0
@s2t2
s2t2 / README.md
Created March 18, 2017 06:37 — forked from pykerl/README.md
Color scheme picker using ColorBrewer scales.
Color scheme picker using ColorBrewer scales

A color scheme picker based on Mike Bostock's visual reference to every ColorBrewer scale (colors by Cynthia Brewer). Not perfect, but just a first try.

Mike Bostock's color brewer scales are available in CSS and JS format.

Click on a palette to change the color scheme. The data is based on 2010 US Census blocks for Georgia aggregated into grid squares.

@s2t2
s2t2 / GIF-Screencast-OSX.md
Created January 28, 2017 19:02 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@s2t2
s2t2 / osx_install.sh
Created April 12, 2016 21:16 — forked from t-io/osx_install.sh
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@s2t2
s2t2 / README.md
Created March 27, 2016 04:08 — forked from brattonc/README.md
D3 Liquid Fill Gauge

Liquid Fill Gauge v1.1 - 7/14/2015

Changes:

  • Added support for updating the gauge value after loading is complete. The loadLiquidFillGauge method now returns an object with an update method which allows the gauge value to be changed. Click any of the gauges above to randomly update their value.

Configurable features include:

  • Changeable min/max values.
  • All colors.
@s2t2
s2t2 / index.html
Created March 27, 2016 03:23 — forked from kosamari/index.html
D3.js Hanabi
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
<style>
body {
background: #222;
color:#fff;
font-family: "Helvetica Neue", Helvetica, sans-serif;
@s2t2
s2t2 / README.md
Created March 26, 2016 08:30 — forked from alecrajeev/README.md
United States Congressional Districts Hexagons

U.S. Congressional Districts as Hexagons.

Background

The purpose of this map as detailed on Daily Kos is to represent the congressional districts in the United States accurately. Currently it is difficult to show the districts because some such as those in New York City are very small, while others like Montana are the size of an entire state. Previosly the maps needed to be zoomable to see the districts containing cities. Other represntations such as cartograms warped the country's shape. This map attempts to fix that by giving each congressional district equal area i.e. five regular hexagons.

According to the original Daily Kos article, the map was built by Daniel Donner.

Porting the Map

I did not design the map. This project's purpose is to port the map to a more useable format. I ported the map t

@s2t2
s2t2 / money.rb
Created January 12, 2016 19:26 — forked from c-lliope/money.rb
Reports on the status of your goals in Simple, and catches them up if necessary
require 'capybara/poltergeist'
require 'ruby-progressbar'
session = Capybara::Session.new(:poltergeist)
session.visit("https://bank.simple.com/signin")
session.fill_in("username", with: "USERNAME")
session.fill_in("password", with: "PASSWORD")
session.click_on("Sign in")
@s2t2
s2t2 / README.md
Created June 17, 2015 03:51 — forked from mbostock/.block

Click to add new points. Hit the DELETE key to remove the selected point. Use the dropdown menu to change the interpolation mode.

@s2t2
s2t2 / README.md
Last active August 29, 2015 14:11 — forked from gisminister/README.md

The map shows traffic accidents recorded in Oslo, Norway, for the year 2013.

The Leaflet Markercluster plugin is wonderful. Since the markerclusters are divIcons you can put whatever you want inside them using the iconCreateFunction. I wanted my clusters to reveal more information than just the marker count and figured a pie chart would do the job. So I told the iconCreateFunction to do some D3 magic and this is the result.

The example is a bit more complicated than necessary due to how my dataset is structured. But if you take a look at the defineClusterIcon() function you'll see that I use d3.nest() to build a dataset for the pie chart based on a given property from all the cluster's children. Then I pass this dataset over to the bakeThePie() function together with instructions on how to style the chart. The function returns svg markup which in turn is placed inside the divIcon.

Feel free to suggest improvements.