Skip to content

Instantly share code, notes, and snippets.

geocoder = new google.maps.Geocoder
geocoder.geocode {address: "Margrethepladsen 4, 8000, DK"}, (results, status) =>
if status is google.maps.GeocoderStatus.OK
console.log "(#{results[0].geometry.location.lng()}, #{results[0].geometry.location.lat()})"
else
alert "Unable to query service for address \"#{location}\""
var geocoder;
var _this = this;
geocoder = new google.maps.Geocoder;
geocoder.geocode({
address: "Margrethepladsen 4, 8000, DK"
}, function(results, status) {
if (status === google.maps.GeocoderStatus.OK) {
return console.log("(" + (results[0].geometry.location.lng()) + ", " + (results[0].geometry.location.lat()) + ")");
var geocoder;
geocoder = new google.maps.Geocoder;
geocoder.geocode({
address: "Margrethepladsen 4, 8000, DK"
}, function(results, status) {
if (status === google.maps.GeocoderStatus.OK) {
return console.log("(" + (results[0].geometry.location.lng()) + ", " + (results[0].geometry.location.lat()) + ")");
} else {
@tgk
tgk / README.md
Last active October 6, 2015 19:28
Dots in tables

Experiments with very small pie charts and tables with dots whose size represents a quantity.

@tgk
tgk / Vagrantfile
Created August 14, 2012 05:57
Test suite
Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.host_name = "apache"
config.vm.network :hostonly, "192.168.0.101"
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe "apt"
chef.add_recipe "apache2"
@tgk
tgk / Car.java
Created October 5, 2012 13:21
Boilerplate example
import java.util.Arrays;
public class Car {
private int maxSpeed;
private Wheel[] wheels;
public Car(int maxSpeed, Wheel[] wheels) {
this.maxSpeed = maxSpeed;
this.wheels = wheels;
@tgk
tgk / swing.clj
Created October 8, 2012 17:09
A Swing example in Clojure
(ns swing
(:import [javax.swing JFrame JLabel JButton]
[java.awt.event WindowListener]))
(defn swing []
(let [frame (JFrame. "Fund manager")
label (JLabel. "Exit on close")]
(doto frame
(.add label)
(.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
@tgk
tgk / gist:4124077
Created November 21, 2012 10:01
Adding schema to database (not connection)
(use '[datomic.api :only [q db] :as d])
(def uri "datomic:mem://schema-test")
(d/delete-database uri)
(d/create-database uri)
(def conn (d/connect uri))
(def schema-tx
@tgk
tgk / README.md
Last active October 13, 2015 03:58

Example of how rolling deploys might have been easy on Datomic databases, had Datomic supported change of schema in db snapshots. The example will not work, but illustrates how easy it would have been to operate on a new schema on an old database by performing migration in-memory when needed.

@tgk
tgk / README.md
Last active December 18, 2015 07:09 — forked from mbostock/.block
Test of gist viewer

Mouseover to repel nodes. Weee, nodes!