Skip to content

Instantly share code, notes, and snippets.


Luke Arduini luk-

View GitHub Profile
luk- / gist:3744633
Created Sep 18, 2012 — forked from mstyne/gist:3744554
couchdb init, from debian
View gist:3744633
#!/bin/sh -e
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
luk- / _gradients.sass
Created Sep 20, 2012 — forked from mihar/_gradients.sass
SASS mixing for CSS3 gradients
View _gradients.sass
=gradient($from, $to)
/* fallback/image non-cover color */
background-color: $from
/* Firefox 3.6+ */
background-image: -moz-linear-gradient($from, $to)
/* Safari 4+, Chrome 1+ */
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to))
luk- / inset_input.css
Created Oct 4, 2012 — forked from nrrrdcore/inset_input.css
The Perfect Inset Input CSS
View inset_input.css
input {
height: 34px;
width: 100%;
border-radius: 3px;
border: 1px solid transparent;
border-top: none;
border-bottom: 1px solid #DDD;
box-shadow: inset 0 1px 2px rgba(0,0,0,.39), 0 -1px 1px #FFF, 0 1px 0 #FFF;
View process.js
typeof process !== "undefined" && {} === '[object process]'
luk- / index.html
Created Nov 8, 2012 — forked from mbostock/.block
SVG Linear Gradient (D3)
View index.html
<!DOCTYPE html>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
var w = 960,
h = 500;
luk- / gist:4158931
Created Nov 28, 2012 — forked from fdmanana/gist:832610
The CouchDB replicator database
View gist:4158931

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

View .jshintrc
"predef": [ "assert", "refute", "define" ]
, "boss": true
, "bitwise": true
, "shadow": true
, "trailing": true
, "immed": true
, "latedef": true
, "forin": false
, "curly": false
View gist:5365959
var record = {
id: idgen(20) ,
data: {
ip: parts[0],
agent: parts[1],
url: parts[2],
referrer: parts[3],
mobile: mobile

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 =

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: