Skip to content

Instantly share code, notes, and snippets.

@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

@cdown
cdown / gist:1163649
Last active July 1, 2024 03:35
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@LeZuse
LeZuse / hack.sh
Created March 31, 2012 15:13 — forked from erikh/hack.sh
Useful OSX settings for hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@awidegreen
awidegreen / vim_cheatsheet.md
Last active June 17, 2024 03:41
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@garethrees
garethrees / gist:5591027
Last active October 14, 2020 19:44
Ansible set timezone on Ubuntu host
- name: Group by Distribution
hosts: all
tasks:
- group_by: key=${ansible_distribution}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
tasks:
- name: Set timezone variables
@kkc
kkc / elasticsearch.md
Last active December 29, 2023 00:39
Elasticsearch performance tuning

##TUNING##

Configuration

System: set file descriptors to 32K or 64K

vim /etc/security/limit.conf

#!/usr/bin/python
try:
import boto.ec2
import re
except ImportError, e:
print "failed=True msg='failed to import python module: %s'" % e
sys.exit(1)
ec2_availability_zone_uri = "http://169.254.169.254/latest/meta-data/placement/availability-zone/"
@mary-grace
mary-grace / Resources for Community Professionals.md
Last active June 8, 2021 15:02
Resources for Community Professionals.md

I co-host The Community Pulse with Jason Hand, and with every episode, we get a fantastic list of resources for community professionals. I've begun this gist as a way to keep track of them all. I'm also pulling some of the resources from CMX Hub and CMGRChat (all notes/reviews pulled from these sites). Am I missing anything? Please leave a comment with any books, blogposts, videos, or organizations you'd like to see represented!

Disclaimer:

For the most part, these are not resources I have read/watched/listened to myself. My apologies in advance if there is anything offensive in them. Please leave a comment below or reach out to me on Twitter if there is anything you find that is off-color or untoward in any way.

Books

[_The