- Make sure you have yo installed:
npm install -g yo
- Run:
yo webapp
- Install grunt-contrib-jade:
npm install grunt-contrib-jade --save-dev
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
# This will run `nvm use` everytime you change directory, if | |
# 1. an .nvmrc file is present | |
# 2. there is no .nvmrc but you're not using your default node | |
# Add it to your `.bash_profile` (or wherever else is suitable for your setup). | |
enter_directory(){ | |
if [ "$PWD" != "$PREV_PWD" ]; then | |
PREV_PWD="$PWD"; | |
if [ -e ".nvmrc" ]; then | |
nvm 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<script> | |
(function(Document) { | |
Document.prototype.write = function(s) { | |
var allScripts = document.getElementsByTagName('script'), | |
thisScript = allScripts[allScripts.length-1]; |
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
export PATH := node_modules/.bin:$(PATH) | |
export SHELL := /usr/bin/env bash | |
.PHONY: dev | |
dev: check-nvm install # run `yarn dev` in .nvmrc-mandated node | |
@bash -l -c 'nvm exec --silent yarn -s dev' | |
.PHONY: install | |
install: # install deps using yarn in .nvmrc-mandated node | |
@bash -l -c 'nvm exec --silent yarn -s' |
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
#!/bin/bash | |
log_error () { | |
echo -e "\x1b[31m$1\x1b[0m" | |
} | |
log_info () { | |
echo -e "\x1b[2m$1\x1b[0m" | |
} |
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
const get = (obj = {}, path = '', defaultValue) => | |
path | |
.replace(/\[(.+?)\]/g, '.$1') | |
.split('.') | |
.reduce((o, key) => o[key], obj) || defaultValue; | |
// PERFORMANCE | |
// It's slower than lodash (surprise surprise), but it's about 97% smaller: | |
// https://jsperf.com/get-object-props/4 |
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
This has moved: | |
https://github.com/guardian/frontend/wiki/Browsers-on-theguardian.com |
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 shimCssSupports() { | |
var cssToDOMregEx = /([a-z])-([a-z])/g; | |
function cssToDOMreplacer (str, m1, m2) { | |
return m1 + m2.toUpperCase(); | |
} | |
function cssToDOM(name) { | |
return name.replace(cssToDOMregEx, cssToDOMreplacer).replace(/^-/, ''); | |
} |
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
.26HKGE { -moz-box-sizing: content-box; } | |
.1K1vKh { -moz-osx-font-smoothing: grayscale; } | |
.1qXBy7 { -moz-transform: scale( 0.99999 ); } | |
.Z11Czbh { -ms-text-size-adjust: 100%; } | |
.2z9ye { -webkit-appearance: button; } | |
.25whma { -webkit-appearance: none; } | |
.Vf0dE { -webkit-appearance: textfield; } | |
.Z11mPm0 { -webkit-box-orient: vertical; } | |
.Z23SxXi { -webkit-box-sizing: content-box; } | |
.c6tBr { -webkit-font-feature-settings: 'kern' 1; } |
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
// Will produce 'x is at y' posts | |
FB.api('/me/feed', 'post', { | |
access_token: "", | |
place: "page_id" | |
}, cb); | |
// Will create 'x shared a link - at y' | |
FB.api('/me/feed', 'post', { | |
access_token: "", | |
place: "page_id", |
NewerOlder