This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "editor.fontFamily": "'Hasklig', 'Source code pro'", | |
| "editor.fontSize": 15.4, | |
| //"editor.fontSize": 12, | |
| "editor.rulers": [ | |
| 80, | |
| 120 | |
| ], | |
| "editor.minimap.enabled": false, | |
| "editor.folding": false, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!doctype html> | |
| <head> | |
| <style> | |
| </style> | |
| </head> | |
| <body> | |
| <div> | |
| <canvas id="canvas" width="500" height="500"> | |
| </canvas> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // WIP - needs a context object to store debounce info in. | |
| Function.prototype.debounced = function() {return this} | |
| var a = function(r) {console.log("Hello "+r)} | |
| a.debounced()("World") | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function wordwrap(text, twidth, con) { | |
| con = con || context | |
| twidth = twidth || con.canvas.width | |
| var texts = [text], n = 0, s | |
| while (con.measureText(texts[n]).width > twidth && (s = texts[n].indexOf(" ")) > -1) { | |
| var t = texts[n], a = t.lastIndexOf(" ") | |
| while (con.measureText(t.substr(0, a)).width > twidth && a > s) a = t.lastIndexOf(" ", a-1) | |
| texts[n++] = t.substr(0, a) | |
| texts.push(t.substr(a+1)) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | window.open(canvas.toDataURL()) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function objqstring (obj) { | |
| var a = [] | |
| for (var s in obj) { | |
| a.push(s + "=" + encodeURIComponent(JSON.stringify(obj[s]))) | |
| } | |
| return a.join("&") | |
| } | |
| function qstringobj (qstring) { | |
| var obj = {} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | //clamp(x,a,b) will return the value in the range [a,b] that's closest to x. With just two arguments, clip(x,a) will use the range [-a,a]. | |
| function clamp(x,a,b){return b===undefined?x>a?a:x<-a?-a:x:x>b?b:x<a?a:x} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function asyncForEach(array, cb) { | |
| var queue = array.slice(); | |
| var out = []; | |
| function next() { | |
| if (queue.length > 0) { | |
| var item = queue.shift(); | |
| someAsyncFunc(item, function(o) { | |
| out.push(o); | |
| next(); | |
| }); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // String format function | |
| String.prototype.format = function() { | |
| var args = arguments; | |
| return this.replace(/{(\d+)}/g, function(match, number) { | |
| return typeof args[number] != 'undefined' | |
| ? args[number] | |
| : match | |
| ; | |
| }); | |
| }; | 
NewerOlder