Instantly share code, notes, and snippets.

View activity_status.rb
def activity_status
if currently_working?
elsif worked_recently?
elsif has_activity?
elsif signed_in_at_least_once?

How do I Pomodoro

I'm a big fan of Pomodoro time management technique, created by Francesco Cirillo in the 80's. In this post I'll describe what it is, how I use it (tools and their tweaks), and how it helps me to get through my day.


View screen.css
/* Home
View convertable.rb
included do
scope :processing, where(state: 'processing')
scope :error, where(arel_table[:state].matches('%failed'))
scope :completed, where(state: %w( converted uploaded protected ))
View circle.yml
# This file should be in RAILS_ROOT
- cp config/ config/database.yml
- psql -U ubuntu circle_test < db/structure.sql
View end.scpt
tell application "Finder"
if (name of every application process) contains "Skype" then
tell application "Skype"
send command "SET USERSTATUS ONLINE" script name "pomodoro"
send command "SET PROFILE MOOD_TEXT " script name "pomodoro"
end tell
end if
end tell
tell application "Twitter" to activate
View Preferences.sublime-settings
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"font_size": 13.0,
"ignored_packages": [],
"save_on_focus_lost": true,
"vintage_start_in_command_mode": true,
"caret_style": "wide",
"highlight_line": true,
"fade_fold_buttons": false,
View RubyCheckSyntax.sublime-build
"cmd": ["ruby","-c","$file"]
View deploy_with_bluepill.rb
# Bluepill related tasks
namespace :bluepill do
desc "Stop processes that bluepill is monitoring and quit bluepill"
task :quit, :roles => [:app] do
#run "cd #{release_path} && rvmsudo bundle exec bluepill stop"
#run "cd #{release_path} && rvmsudo bundle exec bluepill quit"
run "rvmsudo bluepill stop"
run "rvmsudo bluepill quit"
View production.pill
Bluepill.application("yourapp", :log_file => "/home/user/www/yourapp/shared/log/bluepill.log") do |app|
app.process("delayed_job") do |process|
process.working_dir = "/home/user/www/yourapp/current"
process.start_grace_time = 10.seconds
process.stop_grace_time = 10.seconds
process.restart_grace_time = 10.seconds
process.start_command = "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell 'default' -c 'RAILS_ENV=production ruby /home/user/www/yourapp/current/script/delayed_job start'"
process.stop_command = "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell 'default' -c 'RAILS_ENV=production ruby /home/user/www/yourapp/current/script/delayed_job stop'"