Skip to content

Instantly share code, notes, and snippets.

View bpedro's full-sized avatar
⌨️
Writing

Bruno Pedro bpedro

⌨️
Writing
View GitHub Profile
@akira28
akira28 / macsetup.sh
Last active February 22, 2023 03:36
Mac Setup
#!/bin/bash
echo "Install brew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo ""
echo "Install apps"
brew cask install --appdir="/Applications" java google-chrome skype vagrant phpstorm firefox radiant-player mysqlworkbench sequel-pro textwrangler
brew cask install --appdir="/Applications" libreoffice slack dropbox imageoptim tunnelblick virtualbox virtualbox-extension-pack the-unarchiver whatsapp
brew cask install --appdir="/Applications" ccleaner android-studio purevpn cyberduck ccleaner calibre coconutbattery flash-player telegram-desktop
brew cask install --appdir="/Applications" spectacle vlc kodi xquartz inkscape launchrocket ngrok transmission gog-galaxy origin steam spotify atom spark
@ruidlopes
ruidlopes / expectations-test.js
Created April 19, 2011 15:38
testing expectations
var expectations = require("./expectations");
var f = function() {
return "we're here";
};
var expect = expectations.create(f);
// multiple bindings
expect.on("checked", console.log);
@ruidlopes
ruidlopes / expectations.js
Created April 19, 2011 15:38
an event-based approach to github.com/bpedro/node-expectation
exports.create = function(checkFunction, data, period) {
var emitter = new (require("events").EventEmitter)();
var wrapper = function(data) {
if (result = checkFunction(data))
emitter.emit("checked", result);
else
setTimeout(emitter.start, period || 1000);
};
emitter.start = function () { emitter.emit("start"); };
@fdmanana
fdmanana / gist:832610
Created February 17, 2011 20:27
The CouchDB replicator database

1. Introduction to the replicator database

A database where you PUT/POST documents to trigger replications and you DELETE to cancel ongoing replications. These documents have exactly the same content as the JSON objects we used to POST to /_replicate/ (fields "source", "target", "create_target", "continuous", "doc_ids", "filter", "query_params".

Replication documents can have a user defined "_id". Design documents (and _local documents) added to the replicator database are ignored.

The default name of this database is _replicator. The name can be changed in the .ini configuration, section [replicator], parameter db.

2. Basics