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
{ | |
"scripts": { | |
"test": "mocha -g", | |
"start": "babel-node server.js", | |
"prestart": "npm run build", | |
"build": "npm-run-all 'build:*'", | |
"build:js": "cross-env NODE_ENV=production browserify -t babelify -t envify src/app.js > static/build.js", | |
"postbuild:js": "uglifyjs static/build.js -o static/build.js", | |
"build:css": "cross-env NODE_ENV=production stylus css/main.styl -o static", | |
"watch": "npm-run-all --parallel 'watch:*'", |
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
// ES6 tl;dr; for beginners | |
// 1. variables | |
// `const` & `let` are scoped at the block level | |
if(true) { | |
let foo = "bar" | |
} | |
foo // ReferenceError | |
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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |