Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
@rjcorwin
rjcorwin / simple-file-attachment-for-couchdb.html
Created November 14, 2012 20:03
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">
; vim: filetype=clojure
(logging/init :file "riemann.log")
(tcp-server)
(udp-server)
(ws-server)
(periodically-expire 10)
@ericbmerritt
ericbmerritt / gist:4013729
Created November 4, 2012 20:53
A script to generate a valid semver version in any git repo
#!/bin/bash
#
# If run inside a git repository will return a valid semver based on
# the semver formatted tags. For example if the current HEAD is tagged
# at 0.0.1, then the version echoed will simply be 0.0.1. However, if
# the tag is say, 3 patches behind, the tag will be in the form
# `0.0.1+build.3.0ace960`. This is basically, the current tag a
# monotonically increasing commit (the number of commits since the
# tag, and then a git short ref to identify the commit.
#
@janl
janl / couchdb-plugins.md
Created October 29, 2012 16:30
The CouchDB Plugin System

The CouchDB Plugin System

This document describes a possible future CouchDB Plugin system.

This is a work in progress, all the feedback is welcome. Please simplify and rewrite this as you see fit.

Once this is a solid description of what we want to build, we cna start building it.

High Level User-Oriented Walkthrough

@cdkamat
cdkamat / emacs-format-file.el
Created October 18, 2012 07:25
Emacs function to batch untabify and reindent
;;; File: emacs-format-file
;; http://www.cslab.pepperdine.edu/warford/BatchIndentationEmacs.html
;; to be run as --
;; emacs -batch *.[ch] -l ~/src/scripts/emacs-format-file -f emacs-format-function
(defun emacs-format-function ()
"Format the whole buffer."
(if (< 1 (count-windows))
(delete-other-windows (selected-window)))
(catch 'tag
@lmullen
lmullen / gist:3767386
Created September 22, 2012 18:50
Make all markdown files in directory into PDFs
# Produce PDFs from all Markdown files in a directory
# Lincoln Mullen | http://lincolnmullen.com | [email protected]
# List files to be made by finding all *.md files and appending .pdf
PDFS := $(patsubst %.md,%.md.pdf,$(wildcard *.md))
# The all rule makes all the PDF files listed
all : $(PDFS)
# This generic rule accepts PDF targets with corresponding Markdown
@paulirish
paulirish / gist:3098860
Created July 12, 2012 15:26
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

@rodw
rodw / backup-github.sh
Last active May 6, 2025 09:02
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).
@jimklo
jimklo / a-spidermonkey-test.js
Created July 2, 2012 22:43
OpenPGP.js with SpiderMonkey example
// make check for navigator properties not fail.
var navigator = {};
// support some basic HTML5 localStorage operations
function _localStorage() {
this.ls = {};
this.getItem = function(key) {
@dch
dch / GITHUB-COMPARE-LINKS.md
Created July 2, 2012 09:04 — forked from mbbx6spp/GITHUB-COMPARE-LINKS.md
This Gist is worth a million beers. So buy me one (or send me a really cool t-shirt, make sure it is REALLY cool though)! :)