Skip to content

Instantly share code, notes, and snippets.

View ingoradatz's full-sized avatar
🎯
Focusing

Ingo Radatz ingoradatz

🎯
Focusing
View GitHub Profile
@ingoradatz
ingoradatz / gist:2416261
Created April 18, 2012 20:18 — 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

@ingoradatz
ingoradatz / portable-node.md
Created May 27, 2012 05:52 — forked from domenic/portable-node.md
Tips for Writing Portable Node.js Code

Tips for Writing Portable Node.js Code

(This is the kind of thing I should put on my hypothetical blog.)

I'm a Node.js user... on Windows. (Gasp!) And here are some of the issues I face every day:

Easy to Fix

In order of most-violated to least-violated:

@ingoradatz
ingoradatz / gist:3106872
Created July 13, 2012 19:30 — forked from paulirish/gist:3098860
Open Conference Expectations

Open Conference Expectations

This document lays out some baseline expectations between conference speakers and conference presenters. The general goal is to maximize the value the conference provides to its attendees and community and to let speakers know what they might reasonably expect from a conference.

We believe that all speakers should reasonably expect these things, not just speakers who are known to draw large crowds, because no one is a rockstar but more people should have the chance to be one. We believe that conferences are better -- and, dare we say, more diverse -- when the people speaking are not just the people who can afford to get themselves there, either because their company paid or they foot the bill themselves. Basically, this isn't a rock show rider, it's some ideas that should help get the voices of lesser known folks heard.

These expectations should serve as a starting point for discussion between speaker and organizer. They are not a list of demands; they are a list of rea

@ingoradatz
ingoradatz / README.md
Created July 16, 2012 20:07
Turning an existing GitHub Issue into a Pull Request

Why?

This command attaches code (pull request) to an existing issue. This prevents:

  • creating a new issue when opening a new pull-request
  • splitting an on-growing discussion from an issue into an pull request issue

Usage?

You can use personal and organization github names and their branches.

git pull-request -i issue-number-without-the-# -b request-to-branch -h request-from-branch

@ingoradatz
ingoradatz / README.md
Created July 17, 2012 22:05
start a discussion on an existing source file (not in a commit) #github

start a discussion on an existing source file (not in a commit)

Often people saying that we can't discus easily about existing code because the discus functionality on code is present in commits only.

But the solution is built-in the statement. Every code is updated with the help of commits - also the first creation step. If we can find the right commit - we are able to start a discussion over existing code that probably exists since a long time.

Here are one possible behavior:

  • enter the repository on the github.com website
  • surf to the file or use the shortcut t to filter by file names (? to finding more keyboard shortcuts)
@ingoradatz
ingoradatz / README.markdown
Created July 23, 2012 18:31 — forked from rn0/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is an extension to Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@ingoradatz
ingoradatz / proxy.sh
Created September 12, 2012 07:31 — forked from mafo5/proxy.sh
npm/proxy skript
#!/bin/sh
proxy=proxy.clust:3128
export http_proxy=http://$proxy
export https_proxy=http://$proxy
export ftp_proxy=http://$proxy
export socks_proxy=http://$proxy
export no_proxy="127.0.0.1,localhost"
@ingoradatz
ingoradatz / simple-file-attachment-for-couchdb.html
Created November 17, 2012 17:43 — forked from rjcorwin/simple-file-attachment-for-couchdb.html
A very basic example in Javascript of how to attach a file to a CouchDB document. This will work wether or not the Document ID you define exists.
<!DOCTYPE html>
<! --
A very basic example in Javascript of how to attach a file to a CouchDB document. This will work wether or not the Document ID you define exists.
Log in at /_utils, upload this file to a document, and then view it for your own uploader. See the code for comments. ajaxSubmit() is the magic that attaches
as long as the Couch Doc exists because you can't submit a new Couch Document with an attachment.
by @rjsteinert http://rjsteinert.com
-->
<html xmlns="http://www.w3.org/1999/xhtml">
@ingoradatz
ingoradatz / index.js
Created November 27, 2012 06:10 — forked from max-mapper/index.js
link to lat/lon in native maps app on ios and android from webview (phonegap)
var mapLink = "http://maps.google.com/maps?z=12&t=m&q=loc:" + lat + "+" + lon
if ($.os.ios && navigator.userAgent.match(/iPhone OS 6_/)) mapLink = "Maps://?q=" + lat + "," + lon
if ($.os.android) mapLink = "geo:" + lat + "," + lon + "?z=12&q=" + lat + "," + lon
// assumes you have zepto and zepto.detect loaded
// also you should use target=_blank on your <a> tags
// Short module explanation // Something to gather my thoughts
// // I think this looks cool.
//
module.exports = the_exported_function // Modules are a function. Always.
//
module.exports.extra = extra // Additional API entry points if
module.exports.other = other // desired.
//
var util = require('util') // Other packages from npm or core
var assert = require('assert') // No comma-first due to lots of