Skip to content

Instantly share code, notes, and snippets.

@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 / 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.

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 {
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()) + ")");
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}\""
$(function() {
var map, marker;
map = new google.maps.Map($("#map-canvas")[0], {
zoom: 1,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
map.setCenter(new google.maps.LatLng(0, 0));
marker = new google.maps.Marker({
position: new google.maps.LatLng(56, 32),
map: map
$ ->
map = new google.maps.Map $("#map-canvas")[0],
zoom: 1
mapTypeId: google.maps.MapTypeId.ROADMAP
map.setCenter new google.maps.LatLng(0, 0)
marker = new google.maps.Marker
position: new google.maps.LatLng 56, 32
map: map
A
B
C
fns = [];
_ref2 = ["A", "B", "C"];
_fn = function(ch) {
return fns.push(function() {
return console.log(ch);
});
};
for (_k = 0, _len3 = _ref2.length; _k < _len3; _k++) {
ch = _ref2[_k];
_fn(ch);
fns = []
for ch in ["A", "B", "C"]
do (ch) ->
fns.push -> console.log ch
for f in fns
f()