Skip to content

Instantly share code, notes, and snippets.

@luk-
luk- / gist:3744633
Created September 18, 2012 17:52 — forked from mstyne/gist:3744554
couchdb init, from debian
#!/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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
@luk-
luk- / _gradients.sass
Created September 20, 2012 23:47 — forked from mihar/_gradients.sass
SASS mixing for CSS3 gradients
=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-
luk- / inset_input.css
Created October 4, 2012 23:00 — forked from nrrrdcore/inset_input.css
The Perfect 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;
}
@luk-
luk- / process.js
Created October 17, 2012 16:24 — forked from rwaldron/process.js
// https://github.com/joyent/node/blob/master/src/node.cc#L2103
//
console.log(
typeof process !== "undefined" && {}.toString.call(process) === '[object process]'
);
@luk-
luk- / index.html
Created November 8, 2012 06:20 — forked from mbostock/.block
SVG Linear Gradient (D3)
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.27.1"></script>
</head>
<body>
<script type="text/javascript">
var w = 960,
h = 500;
@luk-
luk- / gist:4158931
Created November 28, 2012 03:56 — forked from fdmanana/gist:832610
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

@luk-
luk- / .jshintrc
Created January 4, 2013 02:38 — forked from rvagg/.jshintrc
{
"predef": [ "assert", "refute", "define" ]
, "boss": true
, "bitwise": true
, "shadow": true
, "trailing": true
, "immed": true
, "latedef": true
, "forin": false
, "curly": false
@luk-
luk- / gist:5365959
Last active December 16, 2015 02:58 — forked from ada-lovecraft/gist:5365946
var record = {
id: idgen(20) ,
data: {
ip: parts[0],
agent: parts[1],
url: parts[2],
referrer: parts[3],
mobile: mobile
}
};
@luk-
luk- / pr.md
Created October 18, 2013 00:06 — forked from piscisaureus/pr.md

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: