Skip to content

Instantly share code, notes, and snippets.

View aik099's full-sized avatar

Alex aik099

View GitHub Profile
@fabpot
fabpot / pr-labels.js
Created December 10, 2013 08:50
Displays pull requests labels on Github. Change 'YOU_API_TOKEN' to a Github token or remove the query parameter altogether (but you will run out of calls very fast).
// ==UserScript==
// @name Adds Labels on Github Pull Request
// @namespace http://fabien.potencier.org
// @include https://github.com/*/*/pulls*
// @version 2
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// ==/UserScript==
$(function() {
$(".pulls-list .list-group-item h4").each(function() {
var pull_request = this;
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"