$ brew install selenium-server-standalone chromedriver
$ git clone [email protected]:theintern/intern.git
$ cd intern
$ npm install --production
$ ln -s .. node_modules/intern
$ curl https://gist.github.com/neonstalwart/6630466/raw/f0e4e4efbefa40c746f7c68e2bb4fa0dd5215047/selftest.local.intern.js > tests/selftest.local.intern.js
$ java -jar /usr/local/opt/selenium-server-standalone/selenium-server-standalone-2.35.0.jar -p 4444 &
$ node node_modules/intern/runner.js config=tests/selftest.local.intern
(Also see [remarkable][], the markdown parser created by the author of this cheatsheet)
Below is a collection of my favourite responses I gathered from Guardian engineers when asked the question: What have you learnt starting from scratch and building a mobile-first next generation web platform for the Guardian?
- Work with great people.
- Deploy like crazy. This means the team has to control the infrastructure as well as code.
- Design is not a service. Designers have to sit in the team.
- Infrastructure is intrinsically unreliable. Discard and replace is the robust strategy.
- Use your CDN for HTML too.
- Don't always do as you are told.
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 istype(obj) { | |
return (typeof obj !== 'object' || typeof obj[0] === 'undefined') | |
? typeof obj | |
: 'array'; | |
} |
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 | |
# Copyright (c) 2013 Niggler | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTW |
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
// before you launch this script, make sure you have phantomjs v1.8 installed | |
// and launch it with the port specified in the options: ´$ phantomjs --webdriver=3456´ | |
var http = require('http'); | |
// request body for "/wd/hub/session" request | |
var body = JSON.stringify({desiredCapabilities: {browserName: 'firefox', version: '', platform: 'ANY'}}); | |
// base options for post requests | |
var options = { |
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
/** | |
* | |
* MOVED TO: https://github.com/iFind/html5MultidimensionalStorage | |
* | |
* This methods extends the default HTML5 Storage object and add support | |
* to set and get multidimensional data | |
* | |
* @example Storage.setObj('users.albums.sexPistols',"blah"); | |
* @example Storage.setObj('users.albums.sexPistols',{ sid : "My Way", nancy : "Bitch" }); | |
* @example Storage.setObj('users.albums.sexPistols.sid',"Other songs"); |
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 | |
if [ "$1" == "" ]; then | |
echo Usage: $0 pngfile | |
exit 0; | |
fi | |
FILE=`basename $1 .png` | |
if [ ! -e $FILE.png ]; then |
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
# url.coffee | |
# by Aseem Kishore ( https://github.com/aseemk ), under MIT license | |
# | |
# A simplified wrapper around the native 'url' module that returns "live" | |
# objects: updates to properties are reflected in related properties. E.g. | |
# updates to the `port` property will be reflected on the `host` property. | |
# | |
# The public API and behavior are pretty close to the native 'url' module's: | |
# http://nodejs.org/docs/latest/api/url.html Currently lacking / known issues: | |
# |
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> | |
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Breakpoint detection test</title> | |
<style type="text/css" media="screen"> | |
@media screen and (min-width: 320px) { | |
#page:after { | |
content: 'smallest'; /* represent the current width-bracket */ |