This file contains 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> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>nest.key</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
(function(window){ |
This file contains 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
nest.request('/bts/api/post', { | |
'content-type': 'application/json; charset=utf-8', | |
'accept': 'application/json' | |
}).post(values, function() { | |
console.log(this.responseText); | |
}); |
This file contains 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
//const Proxy = require('harmony-proxy'); | |
function Publisher() { | |
this.subscribers = []; | |
var self = this; | |
this.public = new Proxy({}, { | |
get: function (target, name) { | |
return target[name]; | |
}, | |
set: function (target, name, value) { |
This file contains 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 Tabula(init) { | |
this.fields = init.fields; | |
this.values = init.values; | |
function maxFieldLength(values, fields) { | |
return values.map(function(value, index) { | |
return Math.max(value.length, fields[index % fields.length].length); | |
}).map(function(value, index, full) { | |
return Math.max(value, full[index + full.length/2]); |
This file contains 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
{ | |
"name": "some app", | |
"version": "1.2.0", | |
"description": "i do a neat thing sometimes", | |
"main": "start.js", | |
"dependencies": { | |
"sequelize": "~1.3.7" | |
}, | |
"devDependencies": { | |
"promise": "~7.0.1", |
This file contains 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
// eslint-disable-next-line max-len | |
const keymap = [ '', '', '', 'CANCEL', '', '', 'HELP', '', 'BACK_SPACE', 'TAB', '', '', 'CLEAR', 'ENTER', 'RETURN', '', 'SHIFT', 'CONTROL', 'ALT', 'PAUSE', 'CAPS_LOCK', 'KANA', 'EISU', 'JUNJA', 'FINAL', 'HANJA', '', 'ESCAPE', 'CONVERT', 'NONCONVERT', 'ACCEPT', 'MODECHANGE', 'SPACE', 'PAGE_UP', 'PAGE_DOWN', 'END', 'HOME', 'LEFT', 'UP', 'RIGHT', 'DOWN', 'SELECT', 'PRINT', 'EXECUTE', 'PRINTSCREEN', 'INSERT', 'DELETE', '', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'COLON', 'SEMICOLON', 'LESS_THAN', 'EQUALS', 'GREATER_THAN', 'QUESTION_MARK', 'AT', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'WIN', '', 'CONTEXT_MENU', '', 'SLEEP', 'NUMPAD0', 'NUMPAD1', 'NUMPAD2', 'NUMPAD3', 'NUMPAD4', 'NUMPAD5', 'NUMPAD6', 'NUMPAD7', 'NUMPAD8', 'NUMPAD9', 'MULTIPLY', 'ADD', 'SEPARATOR', 'SUBTRACT', 'DECIMAL', 'DIVIDE', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12', 'F13', 'F14 |
This file contains 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 Machine() { | |
this.states = []; | |
this.current = null; | |
this.verbose = false; | |
} | |
Machine.prototype.advance = function (input) { | |
function next(pass) { | |
this.current = this.states.filter(function (state) { | |
return state.name === this.current.to | |
}, this).pop(); |
This file contains 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
<:import src="some/path">, <:include src="some/path"> | |
imports the file under some/path into the current file | |
<:self>, <:this>, <:i> | |
these are placeholder elements, that indicate where the template's content should be put (in case you want anything before or after) | |
<:if condition> | |
start if statement | |
<:else> | |
start else statement | |
<:endif>, <:fi> | |
end if/else statement |
This file contains 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
document = (html / text / comment)+ | |
html = markup:(open document? close?) { | |
return { | |
type: 'element', | |
content: markup | |
} | |
} | |
open = '<' tn:tagname attrs:attribute* '/'? '>' |
This file contains 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
var currentToken, tokens; | |
function nextToken() { | |
return tokens.next().value; | |
} | |
function express(precedence) { | |
var token = currentToken; | |
currentToken = nextToken(); | |
OlderNewer