This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Add Branch Links | |
// @namespace http://www.github.com/ | |
// @version 0.1 | |
// @description Add extra links to branches page | |
// @match https://github.com/*/branches* | |
// @copyright 2014, Kevin Trotter | |
// ==/UserScript== | |
$(function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Add GitHub Repo Links | |
// @namespace http://cskevint.github.io/ | |
// @version 0.1.1 | |
// @description Add some useful links to the header area of a GitHub repo. | |
// @match http*://github.com/* | |
// @copyright 2013, Kevin Trotter | |
// ==/UserScript== | |
$(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convenience version of a common use case of `map`: fetching a property. | |
// The property can be nested using "." notation. | |
// _.pluckNested([{a:{z:1}},{a:{z:2}}],"a.z") ==> [1, 2] | |
_.pluckNested = function(obj, key) { | |
var objKey = key.split('.'); | |
return _.map(obj, function(o) { | |
var value = o, item; | |
_.each(objKey, function(key) { | |
if(_.isObject(value[key])) { | |
value = value[key]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function titleize(sentence) { | |
if(!sentence.split) return sentence; | |
var _titleizeWord = function(string) { | |
return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); | |
}, | |
result = []; | |
sentence.split(" ").forEach(function(w) { | |
result.push(_titleizeWord(w)); | |
}); | |
return result.join(" "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'erb' | |
class HashBinding | |
def initialize(hash) | |
hash.each do |key, value| | |
singleton_class.send(:define_method, key) { value } | |
end | |
end | |
def context |