Skip to content

Instantly share code, notes, and snippets.

View textgoeshere's full-sized avatar

Dave Nolan textgoeshere

View GitHub Profile

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 = [email protected]: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:

require 'singleton'
# outputs a colored call-trace graph to the Rails logger of the lines of ruby code
# invoked during a single request.
#
# Example:
#
# 1) Make sure this file is loaded in an initializer
#
# 2) Add the following to your application.rb in Rails3:
@textgoeshere
textgoeshere / gist:4176973
Created November 30, 2012 16:54 — forked from baob/gist:4176946
Elastic Search File Not Found Errors
... 10 more
[2012-11-30 16:48:58,470][WARN ][index.gateway ] [i-b41873ed] [lodgings][4] failed to snapshot (scheduled)
org.elasticsearch.index.gateway.IndexShardGatewaySnapshotFailedException: [lodgings][4] Failed to perform snapshot (index files)
at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.doSnapshot(BlobStoreIndexShardGateway.java:246)
at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.snapshot(BlobStoreIndexShardGateway.java:160)
at org.elasticsearch.index.gateway.IndexShardGatewayService$2.snapshot(IndexShardGatewayService.java:271)
at org.elasticsearch.index.gateway.IndexShardGatewayService$2.snapshot(IndexShardGatewayService.java:265)
at org.elasticsearch.index.engine.robin.RobinEngine.snapshot(RobinEngine.java:1056)
at org.elasticsearch.index.shard.service.InternalIndexShard.snapshot(InternalIndexShard.java:481)
at org.elasticsearch.index.gateway.IndexShardGatewayService.snapshot(
@textgoeshere
textgoeshere / request_start_variable.patch
Created August 20, 2012 04:29 — forked from rkbodenner/request_start_variable.patch
Add a 'start_time' variable to nginx 0.8.33 to support an X-REQUEST-START header. This header is used by New Relic RPM to record queue time.
--- src/http/ngx_http_variables.c.orig 2010-01-11 03:21:46.000000000 -0800
+++ src/http/ngx_http_variables.c 2010-02-18 10:01:32.000000000 -0800
@@ -93,6 +93,9 @@
static ngx_int_t ngx_http_variable_pid(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data);
+static ngx_int_t ngx_http_variable_start_time(ngx_http_request_t *r,
+ ngx_http_variable_value_t *v, uintptr_t data);
+
/*
@textgoeshere
textgoeshere / graphline.sh
Created July 20, 2012 14:36 — forked from mrtazz/graphline.sh
shell function to quickly check a graphite graph
#
# shell function to print graphite graphs as sparklines in the terminal
# needs https://github.com/holman/spark
#
function graphline() {
GRAPHITEHOST="graphite.example.com"
if [ ! -n "$1" ]; then print "Usage: $0 metric [minutes]"; return 1; fi
if [ ! -n "$2" ]; then MINUTES=10 ; else MINUTES=$2; fi
curl -s "${GRAPHITEHOST}/render?from=-${MINUTES}minutes&target=${1}&format=raw" | cut -d"|" -f 2 | spark ;
}
# HaveFilter matchers for RSpec
# forked from http://gist.github.com/200099
#
# Require in spec_helper.rb and add the following to your spec config block:
# config.include(Shoulda::ActionController::Matchers), :type => :controllers
#
# class HomeController < ApplicationController
# before_filter :require_user, :except => [:action_1, :action_2]
# ...
# end