Skip to content

Instantly share code, notes, and snippets.

@dcposch
dcposch / keybase.md
Created April 21, 2014 12:21
keybase.md

Keybase proof

I hereby claim:

  • I am dcposch on github.
  • I am dcposch (https://keybase.io/dcposch) on keybase.
  • I have a public key whose fingerprint is 42B6 2865 3CB0 3579 D77F F4CA 07E6 92A7 0EB3 743E

To claim this, I am signing this object:

@dcposch
dcposch / index.js
Created March 30, 2015 01:39
requirebin sketch
var Immutable = require('immutable')
var map1 = Immutable.Map({A:1, B:2, C:3})
var map2 = map1.set('B', 0)
var map3 = map1.set('B', 2)
var map4 = Immutable.Map({A:1, B:2, C:3})
document.write('<br/> map1 === map2 after modification? ' + (map1 === map2))
document.write('<br/> map1 === map3 after no-op modification? ' + (map1 === map3))
document.write('<br/> map1 === map4 where map4 is a new map, same keys and values? ' + (map1 === map4))
@dcposch
dcposch / README.md
Created November 11, 2012 22:33
D3GL Hello Earth

Three views, side by side. Drag to rotate, mouse wheel to zoom.

Built with d3gl

@dcposch
dcposch / README.md
Created November 25, 2012 05:18
D3GL Space Exploration

All soft landings accomplished by humans so far on celestial bodies. Click on the year to play back. Drag to rotate, scroll to zoom. Click any landing site for details. Zoom out for transparency, zoom in to make the planets and moons opaque. Red represent Soviet spacecraft, blue represents NASA spacecraft.

We'll add a third color when Elon Musk lands on Mars.

Built with d3gl

@dcposch
dcposch / README.md
Created November 27, 2012 08:01
D3GL Earth Climate

Earth's climate.

Drag to rotate, mousewheel to zoom. Click a play/pause to animate. Click a country for details.

Built with d3gl

@dcposch
dcposch / README.md
Created December 13, 2012 08:26
D3GL Earthquakes

Shows all earthquakes that happened in November 2012.

Demonstrates the .bars() overlay with animated transitions.

Drag to rotate, scroll to zoom. Mouseover any earthquake for details.

Built with d3gl

--
-- Sqlite3 schema extracted from ~/.nylas/edgehill.db
--
CREATE TABLE `JSONObject` (key TEXT PRIMARY KEY, data BLOB);
CREATE UNIQUE INDEX `JSONObject_id` ON `JSONObject` (`key`);
CREATE TABLE `File` (id TEXT PRIMARY KEY,data BLOB,client_id TEXT,account_id TEXT,filename TEXT);
CREATE UNIQUE INDEX `File_id` ON `File` (`id`);
CREATE TABLE `Event` (id TEXT PRIMARY KEY,data BLOB,client_id TEXT,account_id TEXT,_start INTEGER,_end INTEGER);
CREATE UNIQUE INDEX `Event_id` ON `Event` (`id`);
CREATE TABLE `Label` (id TEXT PRIMARY KEY,data BLOB,client_id TEXT,account_id TEXT,name TEXT,display_name TEXT);
// Do this from the renderer process
var notif = new window.Notification('Download Complete', {
body: torrent.name,
silent: true // We'll play our own sound
})
// If the user clicks in the Notifications Center, show the app
notif.onclick = function () {
ipcRenderer.send('focusWindow', 'main')
}
console.time('init')
// require() calls and early initialization
[...]
var state = State.getInitialState()
// `state.saved` is read from and written to a file. All other state is ephemeral.
// First we load state.saved, once that is done, initialize the app.
loadState(init)
console.time('init')
// require() calls and early initialization
[...]
var state = State.getInitialState()
// `state.saved` is read from and written to a file. All other state is ephemeral.
// First we load state.saved, once that is done, initialize the app.
loadState(init)