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 * as express from 'express'; | |
import { join } from 'path'; | |
import { getProxyConfig } from './webpack-dev-server-proxy-conf'; | |
function error(message: string): never { | |
throw new Error(message); | |
} | |
const proxyConfigPath = process.argv[2] || error('Please specify proxy config path as argument.'); |
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
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
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 flatten(s, stack) { | |
if(s === undefined || s === null || (typeof s === 'number' && isNaN(s))) { | |
return 'null'; | |
} else if(s instanceof Date) { | |
return flatten(s.toJSON(), stack); | |
} else if(typeof s === 'object') { | |
stack = stack ? {obj: s, parent: stack} : {obj: s}; | |
if((function cyclic(obj, stack, found) { | |
return found || |
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
// example using the chartist module | |
var Chartist = require('chartist'); | |
var welcomeText = document.createTextNode('Chartist version ' + Chartist.version); | |
var container = document.createElement('div'); | |
container.className = 'ct-chart ct-golden-section'; | |
var styleSheet = document.createElement('link'); | |
styleSheet.rel = 'stylesheet'; |