Skip to content

Instantly share code, notes, and snippets.

Leo Lamprecht leo

Block or report user

Report or block leo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View error-example.html
<!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 Jul 28, 2016
Using npm as a build tool (bad)
View package.json
"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 Mar 11, 2016
The easiest way to add the name of the current route as class to the body.
View ember-body-class.js
Ember.Route.reopen({
activate () {
var classes = this.genClasses()
if (classes !== 'application') {
Ember.$('body').addClass(classes)
}
},
deactivate () {
Ember.$('body').removeClass(this.genClasses())
You can’t perform that action at this time.