Skip to content

Instantly share code, notes, and snippets.


Dion Almaer dalmaer

View GitHub Profile

Keybase proof

I hereby claim:

  • I am dalmaer on github.
  • I am dalmaer ( on keybase.
  • I have a public key whose fingerprint is 0C48 9C88 E848 8F41 F5B3 9150 EB15 FC08 4107 119D

To claim this, I am signing this object:

dalmaer / x
Created Mar 25, 2009
Super-primitive Bespin integration
View x
name: "bespin",
icon: "",
homepage: "",
author: {name: "Atul Varma", email: "",
homepage: ""},
license: "MIT",
description: "Super-primitive Bespin integration.",
help: "You can run any Bespin command-line command via Ubiquity; just make sure you're on a tab with the Bespin editor when you use the command.",
takes: {"command": /.*/},
View indexeddb-sample.js
var db ='books', 'Book store', false);
if (db.version !== '1.0') {
var olddb ='books', 'Book store');
olddb.createObjectStore('books', 'isbn');
olddb.createIndex('BookAuthor', 'books', 'author', false);
// db.version === "1.0";
var index = db.openIndex('BookAuthor');
var matching = index.get('fred');
View indexeddb-objectstore.js
var store = db.openObjectStore('Contact');
var lincoln = {name: 'Lincoln', number: '7012'};
var contact = store.put(lincoln);
// === 1
var contact = store.get(1);
// === 'Lincoln'
View sample-hummingbird-track.js
try {
Gilt.Hummingbird.track( {"pageName":"login","server":"","channel":"login","pageType":null,"prop1":null,"eVar1":null,"prop2":null,"eVar2":null,"prop3":null,"eVar3":null,"prop4":"login page","eVar4":null,"prop5":null,"eVar5":null,"prop6":null,"eVar6":null,"prop7":null,"eVar7":null,"prop8":null,"eVar8":null,"prop9":null,"eVar9":null,"prop10":null,"eVar10":null,"prop11":null,"eVar11":null,"prop12":null,"eVar12":null,"prop13":null,"eVar13":null,"prop14":null,"eVar14":null,"prop15":null,"eVar15":null,"prop16":null,"eVar16":null,"prop17":null,"eVar17":null,"prop18":null,"eVar18":null,"prop19":null,"eVar19":null,"prop20":null,"eVar20":null,"campaign":null,"state":null,"zip":null,"events":"","products":"","purchaseID":null,"trackingServer":"","trackingServerSecure":""} );
} catch(e) {}
View hummingbird-tracker-clientapi.js
HummingbirdTracker = {};
HummingbirdTracker.track = function(env) {
delete env.trackingServer;
delete env.trackingServerSecure;
env.u = document.location.href; = window.innerWidth; = window.innerHeight;
env.guid = document.cookie.match(/guid=([^\_]*)_([^;]*)/)[2];
env.gen = document.cookie.match(/gender=([^;]*);/)[1];
env.uid = document.cookie.match(/user_id=([^\_]*)_([^;]*)/)[2];
dalmaer / coffee2js
Created Apr 6, 2011
Someone wanted a script that converts javascript to coffeescript. easy! ;)
View coffee2js
#!/usr/bin/env perl
print "`";
while (<>) {
print "`";
View qrcodesample.js
// draw a URL that the reader can pick up and launch a browser say
// basic library
// jQuery plugin
View zombie.sample.js
var zombie = require("zombie");
var assert = require("assert");
// Load the page from localhost
zombie.visit("http://localhost:3000/", function (err, browser, status) {
// Fill email, password and submit form
fill("email", "zombie@underworld.dead").
fill("password", "eat-the-living").
View callercalleefun.js
// the code of the "foo" function
// never changes, but the "this" value
// differs in every activation
function foo() {
// caller activates "foo" (callee) and
// provides "this" for the callee