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 'erb' | |
require 'optparse' | |
require 'pathname' | |
PROJECT_ROOT_FILES = %w(.ruby-version Gemfile .env) | |
$verbose = false | |
$force = false | |
$dry_run = false |
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 | |
if ARGV.include? '--help' | |
puts "git-scrub" | |
puts | |
puts "Remove all merged and stale branches." | |
puts | |
puts " merged = merged into master (the command will only run on the master branch)" | |
puts " stale = removed from the remote" | |
exit 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
// ==UserScript== | |
// @name Bitbucket: sort pull requests by number | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Sort pull requests by number | |
// @author Victor Yap, changes by Tijn Schuurmans | |
// @match https://bitbucket.org/*/*/pull-requests/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ |
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
sudo dd if=raspberrypi.dmg of=/dev/rdisk2 bs=1m |
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
#!/bin/sh | |
cat /proc/cpuinfo | grep Serial | sha256sum | cut -f1 -d' ' |
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
chromium --incognito --kiosk --disable-translate http://status-manager.herokuapp.com/?id=`rpi-id` |
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
# this script proves that no matter how many bytes you leave out of the original string it won't result in a valid date that is in the specified range (within one year) | |
string = "\x04\x02R\xA6a\xC4M" | |
bytes = string.unpack("C*") | |
MIN = Time.new(2013,1,1) | |
MAX = Time.new(2013,12,31) | |
# equivalent to: | |
# string.bytes |
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
module.exports = (robot) -> | |
robot.hear /\bfucking\s+?(\w+)/i, (msg) -> | |
msg.send "fucking #{msg.match[1]} indeed".toUpperCase() | |
robot.hear /\bfuck(\s+?(?:my|your|this|those|these|our))?\s+?(\w+)/i, (msg) -> | |
pronoun = msg.match[1] | |
subject = msg.match[2] | |
pronoun = pronoun.trim().toLowerCase() if pronoun |
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 | |
# preliminary: | |
# | |
# git clone remote_repo repo | |
# cd repo | |
# for remote in `git branch -r | grep -v master `; do git checkout --track $remote ; done | |
def git_repo(subdir) | |
if File.directory?(subdir + "/.git") |
NewerOlder