Skip to content

Instantly share code, notes, and snippets.

View activity_status.rb
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 Mar 12, 2019
Vladimir Rybas - How do I Pomodoro
View how-do-i-pomodoro.md

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

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 ))
end
.
@vrybas
vrybas / circle.yml
Created Apr 18, 2013
Circle CI rails postgresql structure load
View circle.yml
# 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 Aug 15, 2012 — forked from nclark/end.scpt
applescripts for pomodoro.app
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,
@vrybas
vrybas / RubyCheckSyntax.sublime-build
Created Apr 5, 2012
Ruby Check Syntax build system for Sublime Text 2
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'"
You can’t perform that action at this time.