Skip to content

Instantly share code, notes, and snippets.

View postfalk's full-sized avatar

Falk Schuetzenmeister postfalk

  • The Nature Conservancy
  • San Francisco, CA
View GitHub Profile
@postfalk
postfalk / README.md
Last active August 29, 2015 14:15
Ecoengine Visualization Example: Sensors Line Chart
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@postfalk
postfalk / create_geodata.sql
Last active August 29, 2015 14:17
Example files for PostgreSQL tutorial
BEGIN;
-- CREATE SOME POINT LOCATIONS
DROP TABLE IF EXISTS geostuff.locations;
DROP SEQUENCE IF EXISTS geostuff.locations_id;
CREATE SEQUENCE geostuff.locations_id START 1;
CREATE TABLE geostuff.locations (
id integer PRIMARY KEY DEFAULT nextval('geostuff.locations_id'),
name varchar(30),
geom geometry(POINT, 4326));
ALTER TABLE geostuff.locations OWNER TO dbuser;
@postfalk
postfalk / main.java
Last active August 29, 2015 14:18
First pass connecting Arduino to DataTurbine
import com.rbnb.sapi.SAPIException;
import edu.ucsd.rbnb.simple.*;
import jssc.SerialPort;
import jssc.SerialPortException;
public class main {
public static void main(String[] args) {
SerialPort serialPort = new SerialPort("/dev/rfcomm1");
String buffer = "";
SimpleSource src = new SimpleSource("Arduino Sensors");
@postfalk
postfalk / d3tutorial.css
Last active August 29, 2015 14:20
d3 tutorial 2nd step
.axis path,
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
.axis text {
font-family: sans-serif;
font-size: 11px;
@postfalk
postfalk / README.md
Last active August 29, 2015 14:21
Chloropleth: California population change 2012-2010

Using census data.

@postfalk
postfalk / d3tutorial.css
Last active August 29, 2015 14:21
add transformations
.axis path,
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
.axis text {
font-family: sans-serif;
font-size: 11px;
@postfalk
postfalk / d3tutorial.js
Last active August 29, 2015 14:21
interactive squares
// This is called a closure which makes sure that all variables stay local.
// Start script when everything is loaded properly.
window.onload = (function () {
var data = [['red', 0],
['green', 30],
['blue', 60]];
var canvas = d3.select('#canvas').append('svg:svg');
var update = function (data) {
// This selection is the same for appending, updating, and removing elements
// for this reason I am using a variable here. I think this pattern makes it
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
Hello world!
@postfalk
postfalk / .gitignore
Last active October 27, 2015 04:55
Z80 governed by Arduino UNO
*.bin
*_test*