Skip to content

Instantly share code, notes, and snippets.

View vrybas's full-sized avatar

Vladimir Rybas vrybas

View GitHub Profile
def activity_status
if currently_working?
'working'
elsif worked_recently?
'active'
elsif has_activity?
'inactive'
elsif signed_in_at_least_once?
'no_activity'
else
@vrybas
vrybas / how-do-i-pomodoro.md
Last active March 12, 2019 11:08
Vladimir Rybas - How do I Pomodoro

vrybas.github.io

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.

Interruptions

/*****************************************************************************/
/*
/* Home
/*
/*****************************************************************************/
included do
scope :processing, where(state: 'processing')
scope :error, where(arel_table[:state].matches('%failed'))
scope :completed, where(state: %w( converted uploaded protected ))
end
.
@vrybas
vrybas / circle.yml
Created April 18, 2013 03:40
Circle CI rails postgresql structure load
# This file should be in RAILS_ROOT
database:
override:
- cp config/database.yml.ci config/database.yml
- psql -U ubuntu circle_test < db/structure.sql
@vrybas
vrybas / end.scpt
Created August 15, 2012 02:56 — forked from nclark/end.scpt
applescripts for pomodoro.app
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
{
"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,
@vrybas
vrybas / RubyCheckSyntax.sublime-build
Created April 5, 2012 16:46
Ruby Check Syntax build system for Sublime Text 2
{
"cmd": ["ruby","-c","$file"]
}
...
# 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"
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'"