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/sh | |
# https://twitter.com/bodojs/status/476973611753152512 | |
# https://twitter.com/bodojs/status/476974684974501888 | |
# Bash Add-On Autoloader | |
[[ -d "$HOME/.bash" ]] || mkdir -p "$HOME/.bash" | |
[[ -f "$HOME/.bash/cl.sh" ]] || curl -o "$HOME/.bash/cl.sh" https://gist.githubusercontent.com/janl/e6ceb14ffcfca3556ba5/raw/b89254f3babe217bbdb085ad9a4df30cbbd6c1d8/cl.sh | |
source "$HOME/.bash/cl.sh" |
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/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: node.js /home/bodokaiser/tmp/<name> | |
# | |
. /etc/rc.d/init.d/functions | |
# application name |
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 | |
source $HOME/.bash_profile | |
set -u | |
set -e | |
# directory name | |
NAME=$(basename $(pwd) .git) |
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/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: node.js /home/bodokaiser/tmp/<name> | |
# | |
. /etc/rc.d/init.d/functions | |
# application name |
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
var path = require('path'); | |
/** | |
* Your configuration may look like: | |
* | |
* { | |
* "name": "my-app", | |
* "static": { | |
* "path": "/public" | |
* } |
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
var string = 'colors:red, colors:blue, sizes:42, sizes:44'; | |
var obj = string.split(', ') | |
.map(function(entry) { | |
return entry.split(':').reduce(function(prev, curr) { | |
if (!prev.name) { | |
prev.name = curr; | |
prev.value = ''; | |
} else { | |
prev.value += curr; |
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
var string = 'name:stock, vars:colors:red, vars:colors:blue,vars:sizes:44, really:nasty:nested'; | |
function parse(array) { | |
return array | |
.map(function(item) { | |
var parts = item.split(':'); | |
return { | |
key: parts.shift(), | |
value: parts.join(':') |
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
var fs = require('fs'); | |
var path = require('path'); | |
var util = require('util'); | |
var jade = require('builder-jade'); | |
var bundler = require('component-bundler'); | |
var builder = require('component-builder'); | |
var resolver = require('component-resolver'); | |
var runtime = builder.scripts.require + jade.runtime; |
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
package main | |
import ( | |
"log" | |
"fmt" | |
"encoding/json" | |
) | |
var conf1 = ` | |
{ |
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
// in this case we inject the database as argument to another package | |
package httpd | |
import ( | |
"net/http" | |
"path/to/db" | |
) | |
var db *db.Database |