Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"
@benweet
benweet / UserCustom extension
Created October 26, 2014 18:08
[StackEdit] Fix for CouchDB import
// To be copy/pasted in Settings>Extensions>UserCustom
utils.decodeBase64 = function(str) {
return decodeURIComponent(window.escape(window.atob(str)));
};
@benweet
benweet / get_rev.sh
Last active November 20, 2015 23:45
Get file revision
curl https://app.classeur.io/api/v1/files/ApP3fU20RBsiuJluYrbY/fromRev/40157/toRev/40157 \
-u $USER_ID:$API_TOKEN
@benweet
benweet / client.js
Last active June 28, 2016 22:09
socket.io / engine.io load balancing with stickyness using nginx hash
// Same random hash will be used during the whole session
var hash = Math.random().toString(36).slice(2, 10)
// Get absolute uri
var uri = document.createElement('a')
uri.href = '/engine.io/?hash=' + hash
var socket = eio(uri.href)
@benweet
benweet / Welcome file abcd.md
Last active September 25, 2017 08:59
Welcome file

Welcome to StackEdit!

Hey! I'm your first Markdown document in StackEdit[^stackedit]. Don't delete me, I'm here to help! I can be recovered anyway in the Utils tab of the Settings dialog.

Documents

StackEdit stores your documents in your browser, which means all your documents are automatically saved locally and are accessible offline!

Note: