I hereby claim:
- I am charlottegore on github.
- I am charlottegore (https://keybase.io/charlottegore) on keybase.
- I have a public key whose fingerprint is 2B6F 37DB 3A03 12D6 0228 5BB3 DEB1 06AF 9767 EF5E
To claim this, I am signing this object:
| var panda = function () { | |
| var bambooLevel = 0, | |
| isAsleep = false, | |
| wakeUp, | |
| eatBamboo, | |
| goToSleep; | |
| wakeUp = function() { | |
| isAsleep = false; | |
| } |
| { | |
| _links : { | |
| self : { | |
| href: "/tasks/2" | |
| }, | |
| curie : { | |
| name : "controls", | |
| href : "/tasks/2#controls/{rel}", | |
| templated : true | |
| }, |
| var test = dom('<a href="#products/{{_links.self.products}}" alt="something" rel="{{rels.products}}" />Check out all the {{products}}</a>'); | |
| var props = []; | |
| Array.prototype.forEach.call(test.els[0].attributes, function(attr){ | |
| var tokens = attr.nodeValue.split(/\{\{|\}\}/); | |
| if(tokens.length > 1){ | |
| var i = 0; | |
| tokens.forEach(function(t){ | |
| i++; |
| // in app initialisation | |
| var views = new HyperboneView() | |
| .registerHelper('parser', require('marked')) | |
| .registerHelper('date', require('date-formating-module')); | |
| // test data.. | |
| var html = dom('<div>{{ parser( ProductDescription )}}</div>'); | |
| var model = new HyperboneModel({ ProductDescription : "__hello world__" }); | |
| // done automatically in a route handler... |
| /* GET:/ */ | |
| { | |
| "_links" : { | |
| "self" : { | |
| "href" : "/" | |
| }, | |
| "curie" : { | |
| "name" : "controls" | |
| "href" : "/rels/{rel}", | |
| "templated" : true |
| editresource : { | |
| method : "PUT", | |
| action : "/someaction", | |
| encoding: "x-form-www-encoding" | |
| properties : { | |
| "username" : "Current Username", | |
| "email" : "[email protected]", | |
| "etag" : "123j123j1llkj31ljflkjsdlkj32lkjlkjf", | |
| "things" : [1, 2] | |
| }, |
I hereby claim:
To claim this, I am signing this object:
| // version one... Create a clamp method. | |
| Math.prototype.clamp = function clamp (num, min, max){ | |
| return Math.min(min, Math.max(num, max)); | |
| } | |
| function getDayOfWeek (day){ | |
| return Math.clamp(day / 7, 0, 51) | |
| } | |
| // version two, module style |
| function Tiger (){ | |
| this.name = ""; | |
| this.isKing = false; | |
| } | |
| Tiger.prototype = { | |
| getName : function (){ | |
| if (this.isKing){ | |
| return this.name + ", who is the mother fucking King!"; | |
| } else { |
| function Tiger (){ | |
| this.name = ""; | |
| this.isKing = false; | |
| // you can define the methods this way... | |
| this.setName = function (name){ | |
| this.name = name; | |
| }; |