This file contains 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 Github file extension hider | |
// @namespace http://toys.byjp.me/ | |
// @version 0.1.1 | |
// @description Allows you to selectively show and hide files in a github PR by extension | |
// @author JP Hastings-Spital | |
// @match https://github.com/*/*/pull/* | |
// ==/UserScript== | |
(function() { |
This file contains 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
# Add this to your `/etc/profile` (or `~/.bash_profile` etc). Because some people just use commands plain *wrong*. | |
# | |
# You trust me, don't you? | |
echo "cm0oKSB7IGlmIFtbICQxID09ICItZnIiIF1dOyB0aGVuIGVjaG8gIkknbSBhZnJhaWQgdGhlIEZyZW5jaCBhcmUgaGVyZSB0byBzdGF5LiI7IGVsc2UgY29tbWFuZCBybSAkQDsgZmk7IH0=" | base64 -D | sh |
This file contains 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
(crontab -l; echo "* * * * * echo 'https://www.youtube.com/watch?v=BROWqjuTM0g' | pbcopy" ) | crontab - |
This file contains 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 Let's Git Pivotal | |
// @namespace uk.co.deliveroo.labs | |
// @version 0.4 | |
// @description Looks for Pivotal Tracker story ids anywhere on github.com. Any string that looks like: "#12345678" will have a link inserted to the corresponding pivotal tracker story. Don't worry, this will not interfere with github issues, until the ten millionth issue. | |
// @include https://github.com/* | |
// ==/UserScript== | |
"use strict"; |
This file contains 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
# Soooooo. Its hacky, and I'm sure there are improvements (shout if you have any) but... | |
# # # # # # # # # # # # # # # # # # # # # # # # | |
# - - - Where On The Web - - - | |
# A ruby-processing tool that lets you visualize where your network traffic is coming from. | |
# | |
# My thanks to jashkenas for his excellence - not only in releasing ruby-processing | |
# but also for his rapid help in the forums when Java and Ruby fell out. | |
# | |
# Code as art, | |
# JP - jphastings.tumblr.com |
This file contains 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
// Lets javascript add twitter links to @reply style text items in any selected html elements | |
// Requires MooTools' selectors | |
function tumblrTweets(selector) { | |
$$(selector).each(function(t) { | |
t.set('html',t.get('html').replace(/@([a-zA-Z0-9_]+)/,"<a href=\"http://twitter.com/$1\">$1</a>")); | |
}); | |
} |
This file contains 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
class Time | |
# Gives a 'fuzzy' output of the distance to the time stored. | |
# | |
# eg. 'in 28 minutes' or '23 hours ago' | |
def roughly | |
diff = self.to_i - Time.now.to_i | |
ago = diff < 0 | |
diff = diff.abs | |
case diff | |
when 0 |
This file contains 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
# Cheers Andrew http://www.ruby-forum.com/topic/187508 | |
require 'delegate' | |
# Allows percentages to be inspected and stringified in human | |
# form "33.3%", but kept in a float format for mathmatics | |
class Percentage < DelegateClass(Float) | |
def to_s(decimalplaces = 0) | |
(((self * 10**(decimalplaces+2)).round)/10**decimalplaces).to_s+"%" | |
end |
This file contains 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
# Thanks Ellie and Robert! http://www.ruby-forum.com/topic/187604 | |
# Allows relative times, most frequently used in times of arrival etc. | |
class ETA < Time | |
# Takes a number of seconds until the event | |
def self.new(seconds) | |
raise "ETA requires a number of seconds" if not seconds.is_a?(Numeric) | |
at Time.now + seconds | |
end | |
# Requires http://gist.github.com/116290 |
This file contains 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
#!/usr/bin/env ruby | |
require 'plw' | |
### Program | |
if ARGV[0].nil? or not File.exists? ARGV[0] | |
$stderr.puts "Usage: #{$0} filename.plw\n You must specify a PLW file to parse" | |
Process.exit | |
end | |
$stdout.sync = true |
OlderNewer