Skip to content

Instantly share code, notes, and snippets.

View Kingdutch's full-sized avatar

Alexander Varwijk Kingdutch

View GitHub Profile
@Kingdutch
Kingdutch / beers_controller.rb
Last active November 17, 2015 12:24
This is an example response for the Vestingbar Beer API (VBBAPI).
class BeersController < ApplicationController
before_action :set_beer, only: [:show, :update, :destroy]
# GET /beers
def index
@beers = Beer.all
data = []
included = []
@Kingdutch
Kingdutch / legacy.js
Created January 18, 2012 21:44 — forked from JeffreyWay/legacy.js
Legacy JS
// THE GOAL
// Write $('ul').on('click', 'a', fn); in JavaScript
// Must support old IE (so no Selectors API (matchesSelector) or anything)
// Can you shorten this?
var addEvent = (window.addEventListener ?
function (el, ev, fn) {
el.addEventListener(ev, fn, false);
} :
function (el, ev, fn) {
// We prepare some modules we'll need
var sys = require("sys"),
http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs");
var config = Array();
config['run_as'] = 'kingdutch';