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 | |
local_branch = `git rev-parse --abbrev-ref HEAD`.chomp | |
valid_branch_regex = /^(task|chore|feature|fix|text|hotfix|release)\/[a-z0-9._-]{2,30}$/ | |
if local_branch =~ valid_branch_regex | |
exit 0 | |
else | |
puts "Branch name does not match our convention, please make sure it follows this pattern: #{valid_branch_regex}" |
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
Looks like you found one of my discs with a QR code on it! Thanks for taking the time to scan it and read this page. | |
I love getting my discs back when I've lost or forgotten them. I always offer a reward in the form of a disc or two from my disc storage in exchange for getting my disc back. | |
Since this page is public, I'm not including my phone number. | |
Email me here: [email protected] | |
Include your phone # if you want and I'll text you since that's probably easier |
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
require 'test_helper' | |
class ServiceTest < ActiveSupport::TestCase | |
def setup | |
super | |
@klass = Class.new do | |
include Service |
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 Event | |
def initialize | |
@callbacks = {} | |
end | |
def on(event, &block) | |
@callbacks[event] ||= [] | |
@callbacks[event] << block | |
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
$(function(){ | |
var tokenValue = $("meta[name='csrf-token']").attr('content'); | |
$.ajaxSetup({ | |
headers: {'X-CSRF-Token': tokenValue} | |
}); | |
}) |
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
// Adapted from: https://gist.github.com/1251730 | |
// I like this technique better: https://gist.github.com/3960219 | |
$(function(){ | |
var paramName = $("meta[name='csrf-param']").attr('content'); | |
var paramValue = $("meta[name='csrf-token']").attr('content'); | |
Backbone.sync = _.wrap(Backbone.sync, function(originalSync, method, model, success, error){ | |
if (method == 'create' || method == 'update' || method == 'delete') { | |
// grab the token from the meta tag rails embeds |
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
tt http://trac/cgi-bin/trac.cgi/ticket/%s Jump To Trac Ticket | |
tc http://trac/cgi-bin/trac.cgi/changeset/%s Jump To Trac Commit | |
tp http://trac/cgi-bin/trac.cgi/browser/%s Jump To Trac Path | |
am http://www.allmusic.com/cg/amg.dll?SQL=%s&OPT1=1&Submit=Go&P=amg Search AllMusic | |
movies http://www.google.com/movies?sc=1&near=%s&rl=1 Google Movies |
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 | |
####################### | |
# description: | |
# sends an email to one or more people on a certain day of the week, which rotates every week | |
# an email is sent on monday to advise your recipients which day of the week the taco day falls on | |
# then on the day of the taco day, a brief email will be sent to remind people once again | |
# use cron to schedule this script to be invoked on weekdays at whatever time you want the email to be sent | |
# here is an example: 0 11 * * 1-5 ~/bin/taco-mailer.rb | |
####################### |
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 'rubygems' | |
=begin | |
TimeTracker is a simple way to track time on tasks | |
Start tracking time: ./time_tracker.rb -s some-task-name | |
Stop tracking time: ./time_tracker.rb -f | |
View recorded time for a task: ./time_tracker.rb -h some-task-name |
NewerOlder