Skip to content

Instantly share code, notes, and snippets.

View stavros-zavrakas's full-sized avatar

Stavros stavros-zavrakas

  • Orthogonality
  • Cambridge
View GitHub Profile
@stavros-zavrakas
stavros-zavrakas / roles_invesitgation.md
Created October 18, 2016 17:26 — forked from facultymatt/roles_invesitgation.md
Roles and permissions system for Nodejs
var objectPrototype = Object.prototype;
function getType(val) {
return objectPrototype.toString.apply(val).match(/\[object\s(\w+)\]/)[1];
}
getType("Stavros");
getType(true);
getType(24);
getType([]);
@stavros-zavrakas
stavros-zavrakas / person-object.js
Last active March 16, 2016 23:49
Javascript object
var person = {
firstName: 'firstName',
lastName: 'lastName',
greet: function () {
return 'Hi ' + this.firstName
}
};
var stavros = Object.create(person);