Skip to content

Instantly share code, notes, and snippets.

View nhoffmann's full-sized avatar

Niels Hoffmann nhoffmann

View GitHub Profile
@fennb
fennb / gist:1283573
Created October 13, 2011 06:35
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
@yamti
yamti / taxonConceptRelationship.sql
Created December 1, 2011 12:04
Taxon Concept Relationships with taxon title and reltype
SELECT tr.id, rFrom.titleCache as rFrom, rTo.titleCache as rTO, type.titleCache FROM TaxonRelationship tr INNER JOIN TaxonBase rFrom ON tr.relatedfrom_id = rFrom.id INNER JOIN TaxonBase rTo ON tr.relatedto_id = rTo.id INNER JOIN DefinedTermBase type ON tr.type_id = type.id WHERE type.titleCache not like 'Congruent to'
ORDER BY tr.id DESC
@rwaldron
rwaldron / getUserMedia.js
Created March 8, 2012 23:04
Spec style navigator.getUserMedia shim/normalization
/* gum - v0.1.0 - 3/08/2012
* https://github.com/rwldrn/dmv (gum)
* Copyright (c) 2012 Rick Waldron <waldron.rick@gmail.com>; Licensed MIT */
(function( window, navigator ) {
// 2012-03-08 Inspired by https://gist.github.com/f2ac64ed7fc467ccdfe3
// If unprefix.js is available, use it.
// https://github.com/rwldrn/unprefix.js
// Otherwise...
if ( !window.unprefix ) {
@myronmarston
myronmarston / ways_to_use_vcr.rb
Created April 13, 2012 15:00
Ways to use VCR for a request made by a let block
# 1) Use VCR.use_cassette in your let block. This will use
# the cassette just for requests made by creating bar, not
# for anything else in your test.
let(:foo) { VCR.use_cassette("foo") { create(:bar) } }
it "uses foo" do
foo
end
# 2) Wrap the it block that uses #foo in VCR.use_cassette.