Skip to content

Instantly share code, notes, and snippets.

@labe
Last active December 17, 2015 20:29
Show Gist options
  • Save labe/5667640 to your computer and use it in GitHub Desktop.
Save labe/5667640 to your computer and use it in GitHub Desktop.
keep your stress in check when you realize for the billionth time that your table schema is wrong.

##What is this?

This is a ruby file that makes dropping your database precariously, perilously even, tons of fun.

##Where is this?

I put mine in ~/local/boom/ so it's less likely to get accidentally moved or deleted or whatevered.

##How is this?

In my ~/.bash_profile, I added an alias:

alias dropit='ruby ~/local/boom/wub.rb'

so that I can execute it anytime, anywhere in my terminal.

##Why is this?

Because it makes me laugh.

I also have this in my .bash_profile:

alias dubstep='rake db:drop'

...and in my Sinatra app Rakefiles:

namespace :db do desc "Drop the database at #{DB_NAME}" task :drop do   exec %{   source ~/.bash_profile   shopt -s expand_aliases   dropit   }   system("dropdb #{DB_NAME}") end

so whenever I need to drop the database, I just type $ dubstep in the terminal from the Sinatra app root folder.

###BONUS

alias yolo='rake db:create && rake db:migrate && rake db:seed'
// hat tip to @dontmitch and @mikelikesbikes

print "\e[2J"
print "\e[H"
sleep(1)
puts "doodle-oot"
sleep(1)
puts "doodle-oot"
sleep(1)
puts "DOODLE-OOT"
sleep(1)
puts "DOODLE-OOT"
sleep(1)
4.times do
print "DOODLEOOT"
sleep (0.5)
print "DOODLEOOT\n"
sleep (0.5)
end
4.times do
puts "..."
sleep(0.5)
end
puts "(wait for it)"
puts "..."
sleep(0.5)
3.times do
puts "..."
sleep(0.5)
end
print "\e[2J"
print "\e[H"
print "\e[31m"
puts "
# # # # ###
# # # # # #
# # # # # ###
# ## # # # # #
# # ##### ###
"
sleep(0.25)
print "\e[2J"
print "\e[H"
print "\e[33m"
puts "
# # # # ### # # # # ###
# # # # # # # # # # # #
# # # # # ### # # # # # ###
# ## # # # # # # ## # # # # #
# # ##### ### # # ##### ###
"
sleep(0.25)
print "\e[2J"
print "\e[H"
print "\e[36m"
puts "
# # # # ### # # # # ###
# # # # # # # # # # # #
# # # # # ### # # # # # ###
# ## # # # # # # ## # # # # #
# # ##### ### # # ##### ###
# # # # ###
# # # # # #
# # # # # ###
# ## # # # # #
# # ##### ###
"
sleep(0.25)
print "\e[2J"
print "\e[H"
print "\e[32m"
puts "
# # # # ### # # # # ###
# # # # # # # # # # # #
# # # # # ### # # # # # ###
# ## # # # # # # ## # # # # #
# # ##### ### # # ##### ###
# # # # ### # # # # ###
# # # # # # # # # # # #
# # # # # ### # # # # # ###
# ## # # # # # # ## # # # # #
# # ##### ### # # ##### ###
"
sleep(1)
print "\e[5m"
print "\e[2J"
print "\e[H"
print "\e[30;42m"
puts "
DROPPING THE DATABASE
"
sleep(4)
print "\e[0m"
print "\e[2J"
print "\e[H"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment