The stuff before the JSON in heroku logs
output has to be cut off for
bunyan to work.
$ heroku logs | sed -l 's/.*app\[web\..*\]\: //' | bunyan
Flag -l
makes the output buffered by line.
// Config plugins with reliable setup & teardown in Mithril without relying on unique real DOM element lifecycle. | |
// This is meant to stand in for `config` in a way that's more suited to an application that continuously diffs the DOM. | |
import m from 'mithril' | |
// A plugin consists of 1 or more of the following methods: | |
// * init runs once when the plugin first executes | |
// * draw runs on every draw loop | |
// * exit runs at the beginning of the config cycle when the plugin instance has disappeared from view | |
// | |
// Each method is passed the element, the element context / state object, and the virtual DOM element. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// Takes a string and performs the count operation: | |
function counts(s) { | |
var reg = /([\u00BF-\u1FFF\u2C00-\uD7FF\w\d][^,]+),\s*(\d+)/; | |
// Reduce over each line in the string, modifying an accumulator object at every iteration | |
return s.split("\n").reduce(function (a, c) { | |
if (c = reg.exec(c)) { // The regex matches, so it's of the form NAME,NUM, at least in part | |
// c[0] = full regex string | |
// c[1] = the first match (the name) |
source ~/.bashrc | |
source ~/.bash_aliases | |
source /usr/local/opt/chruby/share/chruby/auto.sh | |
source /usr/local/opt/chruby/share/chruby/chruby.sh | |
chruby 2 | |
source /usr/local/Cellar/git/2.0.1/etc/bash_completion.d/git-completion.bash | |
source /usr/local/Cellar/git/2.0.1/etc/bash_completion.d/git-prompt.sh |
# here | |
alias vba='vim ~/.bash_aliases' | |
alias mba='mate ~/.bash_aliases' | |
alias sba='subl ~/.bash_aliases' | |
alias ba='source ~/.bash_aliases' | |
# profile | |
alias sbp='subl ~/.bash_profile' | |
alias bp='source ~/.bash_profile' | |
# bundle | |
alias bu='bundle' |