This file contains hidden or 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
router.use(loadingAnimation) | |
router.use(loadHandlers(router)) | |
router.use(computeAlreadyActive) | |
router.use(modelHook) | |
router.use(activateHook) |
This file contains hidden or 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
# add this to your ~/.bash_profile or similar | |
# say you're on a branch `my-feature` and | |
# you merge the PR for that branch on GitHub | |
# you can now execute `gu` to run the following | |
gu () { | |
branch=$(git symbolic-ref --short HEAD) | |
git checkout master | |
git pull |
This file contains hidden or 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
var webpackConfig = require('./webpack.config') | |
module.exports = function (config) { | |
// prep your webpack config for karma | |
delete webpackConfig.entry | |
webpackConfig.devtool = 'cheap-inline-source-map' | |
config.set({ | |
// standard karma things | |
basePath: '.', |
This file contains hidden or 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
var webpack = require('webpack') | |
var webpackConfig = require('./webpack.config') | |
module.exports = function (config) { | |
// prep your webpack config for karma | |
delete webpackConfig.entry | |
webpackConfig.devtool = 'cheap-inline-source-map' | |
// karma --grep | |
if (config.grep) { |
This file contains hidden or 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
module.exports = function (config) { | |
// karma parses cmd line args, therefore | |
// when executing `karma start --grep some/path` | |
// config will have `grep` set to 'some/path' | |
if (config.grep) { | |
var pattern = config.grep | |
// we then remove the .js suffix, this is useful | |
// because if you're typing `karma start --grep some/test_fi` and tab | |
// the terminal autocompletes to `karma start --grep some/test_file.js` | |
// however, we want to remove this to effectively make use of the |
This file contains hidden or 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
# build and run all tests | |
$ karma start | |
# build and run only those tests that are in this dir | |
$ karma start --grep app/modules/sidebar/tests | |
# build and run only this test file | |
$ karma start --grep app/modules/sidebar/tests/animation_test.js |
This file contains hidden or 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
var grep = require('karma-webpack-grep') | |
var webpackConfig = require('./webpack.config') | |
module.exports = function (config) { | |
webpackConfig.plugins = (webpackConfig.plugins || []).concat(grep({ | |
grep: config.grep, | |
basePath: '.', | |
testContext: './tests' | |
})) |
This file contains hidden or 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
'use strict' | |
let express = require('express') | |
let axios = require('axios') | |
let server | |
function once (cb) { | |
let app = express() | |
app.get('/foo', (req, res, next) => { |
This file contains hidden or 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
[Unit] | |
Description=Playe Controller | |
[Service] | |
ExecStart=/usr/bin/node /home/pi/play/play-controller/controller.js | |
Restart=always | |
RestartSec=5 | |
StandardOutput=syslog | |
StandardError=syslog | |
SyslogIdentifier=play-controller |
This file contains hidden or 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
import axios from 'axios' | |
import fetch from './fetch' | |
export default { | |
async fetchPage ({ dispatch }, { query, headers }, ref) { | |
// every time this action is dispatched, make the request using the fetch helper | |
// which ensures we cancel previous requests and only mutate state after the latest one | |
await fetch(ref, { | |
request: cancelToken => { | |
return Promise.all( |