Skip to content

Instantly share code, notes, and snippets.

View rhutchison's full-sized avatar

Ryan Hutchison rhutchison

View GitHub Profile
@rhutchison
rhutchison / pr.md
Last active September 5, 2015 20:36 — forked from piscisaureus/pr.md
Checkout github pull requests locally

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:

@rhutchison
rhutchison / .README.md
Last active September 5, 2015 20:36 — forked from gnarf/..git-pr.md
Global .gitconfig aliases for GitHub Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from GitHub remotes:

  • git pr 4 - creates local branch pr/4 from the origin remote and checks it out
  • git pr 4 upstream - creates local branch pr/4 from upstream remote and checks it out
// Post repeat directive for logging the rendering time
angular.module('myApp').directive('postRepeatDirective',
['$timeout',
function($timeout) {
return function(scope, element, attrs) {
var timerName = attrs.postRepeatDirective || 'postRepeatDirective';
if (scope.$first) {
if (window.console && window.console.time) {
console.time(timerName);
@rhutchison
rhutchison / jquery.xdomain.js
Created March 26, 2012 16:32 — forked from mathieucarbou/jquery.xdomain.js
jQuery CORS Plugin - transparently add CORS support for IE8+ in jQuery using XDomainRequest. Support cookies.
PROJECT MOVED TO https://github.com/Ovea/cors
/**
* https://gist.github.com/1114981
*
* By default, support transferring session cookie with XDomainRequest for IE. The cookie value is by default 'jsessionid'
*
* You can change the session cookie value like this, before including this script:
*
* window.SESSION_COOKIE_NAME = 'PHP_SESSION';
@rhutchison
rhutchison / gist:1906579
Created February 25, 2012 05:09 — forked from paulirish/gist:366184
html5 geolocation with fallback.
// geo-location shim
// currentely only serves lat/long
// depends on jQuery
;(function(geolocation){
if (geolocation) return;
var cache;