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
| trait Tag | |
| class Concat[A <: Tag, B <: Tag](a: A, b: B) extends Tag | |
| trait NestTag[A <: Tag] extends Tag { | |
| val child: A | |
| } | |
| trait Inline extends Tag | |
| trait Block extends Tag | |
| case class div[T <: Tag](t :T = null) extends NestTag[T] with Block { | |
| val child = t | |
| } |
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
| if exists("g:TSSloaded") | |
| finish | |
| endif | |
| if !has("python") | |
| echoerr "typescript_tss.vim needs python interface" | |
| finish | |
| else | |
| python <<EOF | |
| import vim |
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
| set noautofocus | |
| let hintcharacters = "asdfghjkl;" |
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
| import scala.util.parsing.combinator._ | |
| import scala.util.matching.Regex.Match | |
| import scala.util.matching.Regex | |
| import scala.annotation.{switch, tailrec} | |
| object T extends RegexParsers { | |
| abstract class AbstractSelector[S <: AbstractSelector[S]] |
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
| // import gif.js | |
| (function(c){function a(b,d){if({}.hasOwnProperty.call(a.cache,b))return a.cache[b];var e=a.resolve(b);if(!e)throw new Error('Failed to resolve module '+b);var c={id:b,require:a,filename:b,exports:{},loaded:!1,parent:d,children:[]};d&&d.children.push(c);var f=b.slice(0,b.lastIndexOf('/')+1);return a.cache[b]=c.exports,e.call(c.exports,c,c.exports,f,b),c.loaded=!0,a.cache[b]=c.exports}a.modules={},a.cache={},a.resolve=function(b){return{}.hasOwnProperty.call(a.modules,b)?a.modules[b]:void 0},a.define=function(b,c){a.modules[b]=c};var b=function(a){return a='/',{title:'browser',version:'v0.10.26',browser:!0,env:{},argv:[],nextTick:c.setImmediate||function(a){setTimeout(a,0)},cwd:function(){return a},chdir:function(b){a=b}}}();a.define('/gif.coffee',function(d,m,l,k){function g(a,b){return{}.hasOwnProperty.call(a,b)}function j(d,b){for(var a=0,c=b.length;a<c;++a)if(a in b&&b[a]===d)return!0;return!1}function i(a,b){function d(){this.constructor=a}for(var c in b)g(b,c)&&(a[c]=b[c]);return d.proto |
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
| // import gif.js | |
| (function(c){function a(b,d){if({}.hasOwnProperty.call(a.cache,b))return a.cache[b];var e=a.resolve(b);if(!e)throw new Error('Failed to resolve module '+b);var c={id:b,require:a,filename:b,exports:{},loaded:!1,parent:d,children:[]};d&&d.children.push(c);var f=b.slice(0,b.lastIndexOf('/')+1);return a.cache[b]=c.exports,e.call(c.exports,c,c.exports,f,b),c.loaded=!0,a.cache[b]=c.exports}a.modules={},a.cache={},a.resolve=function(b){return{}.hasOwnProperty.call(a.modules,b)?a.modules[b]:void 0},a.define=function(b,c){a.modules[b]=c};var b=function(a){return a='/',{title:'browser',version:'v0.10.26',browser:!0,env:{},argv:[],nextTick:c.setImmediate||function(a){setTimeout(a,0)},cwd:function(){return a},chdir:function(b){a=b}}}();a.define('/gif.coffee',function(d,m,l,k){function g(a,b){return{}.hasOwnProperty.call(a,b)}function j(d,b){for(var a=0,c=b.length;a<c;++a)if(a in b&&b[a]===d)return!0;return!1}function i(a,b){function d(){this.constructor=a}for(var c in b)g(b,c)&&(a[c]=b[c]);return d.proto |
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
| {isArray, isFunc} = require('./util') | |
| class Extractor | |
| FN_ARGS = /// | |
| ^function # function | |
| \s* # optional white | |
| [^\(]* # function name | |
| \( # left paren | |
| \s* | |
| ([^\)]*) #params | |
| \) # right paren |
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 handlerMaker(obj) { | |
| return { | |
| getOwnPropertyDescriptor: function(name) { | |
| var desc = Object.getOwnPropertyDescriptor(obj, name); | |
| // a trapping proxy's properties must always be configurable | |
| if (desc !== undefined) { desc.configurable = true; } | |
| return desc; | |
| }, | |
| getPropertyDescriptor: function(name) { | |
| var desc = Object.getPropertyDescriptor(obj, name); // not in ES5 |
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
| // bad | |
| function Curry(fn) { | |
| var args = Array.prototype.slice.call(arguments, 1); | |
| var len = fn.length - args.length; | |
| var partial = function () { | |
| var partialArg = Array.prototype.slice.call(arguments); | |
| args = args.concat(partialArg); | |
| if (args.length > len) { | |
| throw new Error('wrong argument lenth: Expected ' + len + '; Receive ' + args.length); |
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
| 'use strict'; | |
| // middlewares: array of generator function | |
| function compose(middlewares) { | |
| return function *() { | |
| var i = middlewares.length; | |
| var prev = function *(){}; | |
| var current; | |
| while (i--) { | |
| current = middlewares[i]; |