Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title>Simple Line Graph using SVG and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
#!/bin/bash
# This script is for exporting MBTiles directly to your Mapbox account.
# Requires a Mapbox account with sufficient storage for your tiles and
# authorized with your TileMill 0.10.0 install.
# Note that the maximum file transfer size is 5GB.
# Adapted from https://gist.github.com/springmeyer/7875415.
# Settings: edit these as needed
PROJECT_NAME="geography-class" # the folder name in your /project directory
OUTPUT_DIRECTORY="~/Documents/MapBox/export/"
#######################################################################
###BASH FOR PROCESSING LANDSAT 8 (8-BIT CONVERSION NEEDED AND INCLUDED)
########################################################################
###MAKE SURE IMAGERY ZIP FILE IS IN L8_IMAGERY FOLDER ON DESKTOP
###THIS SPECIFIC COLOR TWEAKING WAS DESIGNED FOR BAIJI IRAQ AND THEREFORE
###WILL BEST FIT DESERT REGIONS!
Folder="Baiji_Jun18"
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg{
background:#2379d5;
}
.texto{
font-size:13px;
}
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
# things you must configure
PATH_TO_DROPBOX = "/PATH_TO_YOUR_DROPBOX/tweets/" # you must create this folder
TWITTER_USER = "YOUR_USERNAME"
#!/bin/bash
# Mac OSX 10.8 geo setup script
# loads geo stuffs, mostly through homebrew
###################
# Before running:
# - Install Xcode from the Mac App Store.
# - Install the Xcode Command Line Tools by opening Xcode,
# Xcode → Preferences → Downloads → Components →
@jqtrde
jqtrde / data.tsv
Last active August 29, 2015 14:05 — forked from mbostock/.block
sepalLength sepalWidth petalLength petalWidth species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa
4.6 3.4 1.4 0.3 setosa
5.0 3.4 1.5 0.2 setosa
4.4 2.9 1.4 0.2 setosa
@jqtrde
jqtrde / L8.sh
Last active August 29, 2015 14:06 — forked from YKCzoli/L8.sh
#!/bin/bash
echo "Enter bands (ie 4 3 2)"
read B1 B2 B3
echo "Enter the resulting filename"
read outputname
@jqtrde
jqtrde / README.md
Last active August 29, 2015 14:08 — forked from jasondavies/README.md

Based on Mike Bostock’s [World Map][0], modified to automatically colour countries such that no adjacent countries share the same colour.

This is done by extracting the topology via [TopoJSON][1] and greedily picking colours until the constraint is fulfilled.

See also: [Graph coloring][2] on Wikipedia.

Update: Greedily colouring is now performed in a single line, thanks to Mike Bostock!