Skip to content

Instantly share code, notes, and snippets.

View yjukaku's full-sized avatar

Yousuf J yjukaku

  • Shelby TWP, MI
View GitHub Profile
#!/usr/bin/ruby
def prompt(message)
STDOUT.write "#{message}: "
STDIN.gets.strip
end
def error_and_exit!(error)
$stderr.puts error
exit(1)
#!/usr/bin/ruby
# This script will take the ticket number from your current git branch and prepend it to your
# commit so you don't have to type it yourself.
# Run it either like this `./jira_commit Your commit message here`
# or just as `./jira_commit ` and enter your commit message when prompted
current = `git branch`.split("\n").detect{|l| l.start_with?("*")}.gsub("* ", "").strip
ticket = current.match(/(qweb-\d+)/)[1].upcase
message =
@yjukaku
yjukaku / gist:8138580
Last active July 8, 2019 17:32
Play a fail/pass sound after an RSpec Suite without needing any other plugins or gems. This goes in your spec_helper.rb
config.after(:suite) do
examples = RSpec.world.filtered_examples.values.flatten
if examples.none?(&:exception)
file = "spec/pass.wav"
else
file = "spec/fail.wav"
end
fork{exec "play -q -V0 #{file}"}