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
npm config set loglevel http | |
npm config set progress false | |
npm config set shrinkwrap false | |
npm config set save false | |
npm config set package-lock false | |
mkdir -p ~/.config/configstore/ | |
printf '{"optOut": true,"lastUpdateCheck": 0}' > ~/.config/configstore/update-notifier-npm.json |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 app = choo() | |
app.route('/hi', hiView) | |
app.route('/hello', helloView) | |
// static redirect | |
app.route('/greet', redirect('/hello')) | |
// conditional | |
app.route('/greet', function (state, emit) { | |
if (!state.user.sid) return hiView(state, emit) |
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 app = choo() | |
app.use(function (state, emitter) { | |
emitter.on('DOMContentLoaded', function () { | |
emitter.emit('pushState', '/foo/bar') // make sure the app has loaded before firing anything | |
}) | |
}) |
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 infiniteElements = require('cool-scroll-element') | |
var html = require('bel') | |
// Create some test data | |
var data = [] | |
for (var i = 0; i < 500; i++) data.push(i) | |
var list = infiniteElements(function (i) { | |
return html` | |
<div id="row-${i}" style="height: 30px"> |
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 scheduler = Scheduler() | |
var mainComponent = scheduler.new('main') // create a new component with a name | |
mainComponent.on('render', function (state, emit) { | |
return html`` | |
}) | |
mainComponent.on('load', function (done) { | |
/* trigger an animation that runs for 500ms */ | |
setTimeout(500, done) // wait for animation to complete before calling "done" | |
}) | |
mainComponent.on('unload', function (done) { |
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 merry = require('merry') | |
var env = merry.env({ | |
NODE_ENV: String, | |
PORT: Number | |
}) | |
var errors = merry.errors([ | |
{ | |
name: 'ENOTFOUND', |
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 pathname = require('pathname-match') | |
var http = require('http') | |
// this should point to your choo app, which should export if required, | |
// and mount itself if it's the root module. e.g. | |
// | |
// if (module.parent) module.exports = app | |
// else app.mount('body') | |
var app = require('./my-app') |
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
#!/bin/sh | |
# from https://raw.githubusercontent.com/mhart/alpine-node/master/Dockerfile | |
VERSION='v6.10.2' | |
NPM_VERSION='3' | |
CONFIG_FLAGS="--fully-static --without-npm" | |
DEL_PKGS="libstdc++" | |
RM_DIRS=/usr/include | |
apk add --no-cache curl make gcc g++ python linux-headers binutils-gold gnupg libstdc++ && \ | |
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \ |