Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<style>
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
cursor: default;
@leo
leo / package.json
Last active July 28, 2016 10:49
Using npm as a build tool (bad)
"scripts": {
"install": "npm run build",
"start": "parallelshell 'livereload dist' 'nodemon index -w views/ -e hbs,js -i assets/'",
"build:js": "rollup assets/js/app.js > dist/app.js",
"build:scss": "node-sass assets/scss -o dist --output-style compressed",
"build:images": "cp -r assets/images/* dist/images",
"prebuild": "rm -rf dist && mkdir dist && mkdir dist/images",
"build": "npm run build:js && npm run build:scss && npm run build:images",
"watch:js": "watch 'npm run build:js' assets/js",
"watch:scss": "watch 'npm run build:scss' assets/scss",
@leo
leo / ember-body-class.js
Created March 11, 2016 10:51
The easiest way to add the name of the current route as class to the body.
Ember.Route.reopen({
activate () {
var classes = this.genClasses()
if (classes !== 'application') {
Ember.$('body').addClass(classes)
}
},
deactivate () {
Ember.$('body').removeClass(this.genClasses())