Demo of multipart form/file uploading with hapi.js
.
npm install
npm run setup
npm run server
Then ...
exports.findOrCreateDB = function (config, creds, cb) { | |
var nano = require('nano')("http://" + config.couch_admin + ":" + config.couch_password + "@" + config.couch_host + ':' + config.couch_port); | |
var users = nano.use('_users'); | |
var user = { | |
_id: "org.couchdb.user:" + creds.username, | |
name: creds.username, | |
roles: [], | |
type: "user", |
### BEGIN INIT INFO | |
# Provides: Xvfb | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: | |
# X-Start-Before: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Loads X Virtual Frame Buffer | |
### END INIT INFO |
# ~/.config/ReText project/ReText.conf | |
[General] | |
autoSave=true | |
restorePreviewState=true | |
highlightCurrentLine=true | |
tabWidth=2 | |
styleSheet=github.css | |
useWebKit=true | |
autoPlainText=false |
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json) | |
RETURNS json | |
IMMUTABLE | |
LANGUAGE sql | |
AS $$ | |
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json | |
FROM ( | |
SELECT * FROM json_each(data) | |
UNION ALL | |
SELECT * FROM json_each(insert_data) |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="red_50">#fde0dc</color> | |
<color name="red_100">#f9bdbb</color> | |
<color name="red_200">#f69988</color> | |
<color name="red_300">#f36c60</color> | |
<color name="red_400">#e84e40</color> | |
<color name="red_500">#e51c23</color> | |
<color name="red_600">#dd191d</color> | |
<color name="red_700">#d01716</color> |
/* | |
* derivative work of Matheus de Oliveira's json_manipulator.sql | |
* https://gist.github.com/matheusoliveira/9488951 | |
* | |
* adapted to support postgresql 9.4 jsonb type | |
* no warranties or guarantees of any kind are implied or offered | |
* | |
* license is as Matheus conferred it on 4/9/2015: | |
* matheusoliveira commented on Apr 9 | |
* @hannes-landeholm, I'd like to take credit if you share them |
curl -L https://github.com/coreos/etcd/releases/download/v2.1.0-rc.0/etcd-v2.1.0-rc.0-linux-amd64.tar.gz -o etcd-v2.1.0-rc.0-linux-amd64.tar.gz
tar xzvf etcd-v2.1.0-rc.0-linux-amd64.tar.gz
cd etcd-v2.1.0-rc.0-linux-amd64
./etcd
by default etcd listening on port 2379 for client communication and on port 2380 for server to server communication
Test
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get install gcc-5 g++-5 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 |
##based on Mesosphere Marathon's servicerouter.py haproxy config | |
global | |
daemon | |
log 127.0.0.1 local0 | |
log 127.0.0.1 local1 notice | |
maxconn 4096 | |
tune.ssl.default-dh-param 2048 | |
defaults |