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 gulp = require( 'gulp' ), | |
component = require( 'gulp-component' ), | |
tsc = require( 'gulp-typescript-compiler' ); | |
gulp.task( 'default' , [ 'ts' ] , function (){ | |
gulp.src( 'component.json' ) | |
.pipe( component( { | |
standalone: true | |
} ) ) | |
.pipe( gulp.dest( 'build' ) ) |
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() { | |
const a=10; | |
a=20; | |
let b=10; | |
b=20; | |
console.log("a-->" + a); | |
console.log("b-->" + b); | |
var s = true; | |
while (s) { | |
const ic = 10; |
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
@timestampable | |
class Dog { | |
public name: string = 'Paul'; | |
} | |
function timestampable(func) { | |
return <any>(function() { | |
var genericConstructor = () => {}; | |
genericConstructor.prototype = func.prototype; | |
var instance = new genericConstructor(); |
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> | |
<!-- | |
WebGL Taipei meetup #02 | |
author: daoshengmu, http://dsmu.me | |
date: 06/06/2015 | |
--> | |
<html lang="en"> | |
<head> |
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 Markdown(value) { | |
this.value = value || ''; | |
this.length = this.value.length; | |
}; | |
Markdown.prototype = new String; | |
// Instance methods | |
Markdown.prototype.toString = Markdown.prototype.valueOf = function(){return this.value}; | |
Markdown.prototype.toHTML = function(){return Markdown.decode(this)}; |
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
/* | |
* Minimal classList shim | |
* Use with an Array.prototype.indexOf shim to support IE 8 | |
* Derived from work by Devon Govett | |
* MIT LICENSE | |
*/ | |
// NOT INTENDED FOR PRODUCTION USE. |
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
/** | |
* simple mustache-like templater | |
* http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/ | |
* ----------------------------------------------------------------------------------------- | |
* t('Hello, {{planet}}!', {'planet': 'World'}); | |
* returns 'Hello, World!'; | |
*/ | |
function t(s,d){ | |
for(var p in d) | |
s=s.replace(new RegExp('{{'+p+'}}','g'), d[p]); |
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
if("undefined" === typeof document.currentScript){ | |
(function(){ | |
/***************************************************************************/ | |
/* document.currentScript polyfill + improvements */ | |
/***************************************************************************/ | |
var scripts = document.getElementsByTagName('script'); | |
document._currentScript = document.currentScript; | |
// return script object based off of src | |
var getScriptFromURL = function(url) { |
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 customelement = require('./customelement'); | |
export class MyElement extends customelement.CustomHTMLElement { | |
public myTest() { | |
// "this" is fully qualified, includes all methods e.g. addEventListener, dispatchEvent | |
console.log("this", this); | |
console.dir(this); | |
} | |
} |
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 express = require('express'), | |
httpProxy = require('http-proxy'), | |
app = express(); | |
var proxy = new httpProxy.RoutingProxy(); | |
function apiProxy(host, port) { | |
return function(req, res, next) { | |
if(req.url.match(new RegExp('^\/api\/'))) { | |
proxy.proxyRequest(req, res, {host: host, port: port}); |
OlderNewer