Skip to content

Instantly share code, notes, and snippets.


Niels Abildgaard hypesystem

View GitHub Profile

Keybase proof

I hereby claim:

  • I am hypesystem on github.
  • I am hypesystem ( on keybase.
  • I have a public key ASAAUdHwkLmLQJRdaklSiNeae5ujL4exU0j6HXhApB6yiQo

To claim this, I am signing this object:

hypesystem /
Last active Aug 29, 2015
module.parent refers to the first requirer only!

Module.parent is useless

module.parent in a node app refers to the parent module of the current module. This is useful for getting paths (for example) relative to the parent, for example used internally in fileGetter:

// Should get localPath in ./, not localPath in ./lib/some-folder
var fileGetter = require("./lib/some-folder/file-getter.js");
var text = fileGetter("./localPath.dat");
hypesystem / design.json
Created Jun 19, 2015
CouchDB (Hardcoded) Multi-dimensional Query (by using List)
View design.json
_id: "_design/user_actions",
_rev: "some-revision",
views: {
what_ever: {
map: function(doc) {
// ...
hypesystem / main.js
Last active Aug 29, 2015
Insignificant Order Deep-Equals for Arrays and Objects in Javascript
View main.js
function insignificantOrderDeepContains(haystack, needle) {
var matched = false;
haystack.forEach(function(straw) {
if(matched) return;
if(insignificantOrderDeepEquals(straw, needle)) {
matched = true;
return matched;
hypesystem / api.php
Created Mar 9, 2015
Static, dynamic and browser-rendered pages
View api.php
header("Content-Type: application/json");
echo json_encode(array(
"name" => "Wilson",
"gender" => "Ball",
"age" => "13"
hypesystem / private-scoping.js
Last active Aug 29, 2015
Private scope in node.js / dirty, dirty trick to get private methods
View private-scoping.js
var PublicClass = function() {
this.state = "something";
PublicClass.prototype.publicMethod = function() {; //<-- this is a dirty, dirty trick, running *privateFunction* as a private method
function privateFunction() {
console.log(this.state); //<-- in order to make *this* accessible, we need to use the trick above
View test_induced_design_damage.rb
# Original Rails controller and action
class EmployeesController < ApplicationController
def create
@employee =
redirect_to @employee, notice: "Employee #{} created"
render :new
View Range.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/// <summary>
/// Generic implementation of Martin Fowler's Enterprise Pattern ``Range'':
hypesystem / JobApplicant.cs
Last active Aug 29, 2015
3 Job Description - refactored
View JobApplicant.cs
using System.Collections.Generic;
using System.Linq;
///Their own repost:
namespace JobAd