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 sync = require('child_process').spawnSync; | |
| console.log('start ls'); | |
| var ls = sync('ls', ['-lh', '/usr']); | |
| console.log('end ls'); | |
| console.log('start grep'); | |
| var grep = sync('grep', ['local'], { | |
| input: ls.stdout | |
| }) |
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 GAPI = require('node-gcs').gapitoken; | |
| var GCS = require('node-gcs'); | |
| var fs = require('fs'); | |
| var path = require('path'); | |
| var format = require('util').format; | |
| var config = require('../res/config.js').GCS; | |
| const STATIC_URL = "https://storage.googleapis.com"; | |
| const BUCKET = config.BUCKET_NAME; | |
| const FILENAME = "rock-cloud.png"; |
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
| # install dependency first | |
| # http://www.docker.io/gettingstarted/ | |
| sudo apt-get install linux-image-extra-`uname -r` | |
| sudo apt-get install software-properties-common | |
| sudo add-apt-repository ppa:dotcloud/lxc-docker | |
| sudo apt-get update | |
| sudo apt-get install lxc-docker | |
| # Build your nodejs application |
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
| # Might have better command, but should work at least. ;p | |
| npm list -g --depth=0 | awk '{print $2}' | awk -F '@' '{print $1}' | tr "\\n" " " |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>AutoComplete Example</title> | |
| <link rel="stylesheet" type="text/css" href="style.css"> | |
| </head> | |
| <body> | |
| <form> | |
| <!-- Don't forget disable chrome autocomplete --> | |
| <input type="text" id="moz-test" autocomplete="off"> |
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 Duplex = require('stream').Duplex; | |
| var util = require('util'); | |
| function both() { | |
| if (!(this instanceof both)) return new both(); | |
| Duplex.call(this); | |
| } | |
| util.inherits(both, Duplex); |
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
| #!/usr/bin/env node | |
| var fs = require('fs'); | |
| function help() { | |
| var output = [ | |
| 'servant - help you handle those tiny little things', | |
| '', | |
| 'Usage:', | |
| ' servant config - Display servant config files', |
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
| package main | |
| import ( | |
| "fmt" | |
| "labix.org/v2/mgo" | |
| ) | |
| type Person struct { | |
| Name string | |
| Phone string |
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
| package main | |
| import "fmt" | |
| func main() { | |
| f() | |
| fmt.Println("Returned normally from f.") | |
| } |
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
| nodejs-deps: | |
| pkg.installed: | |
| - names: | |
| - build-essential | |
| - g++ | |
| - curl | |
| - libssl-dev | |
| - apache2-utils | |
| - git |