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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby -v | |
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] | |
$ ruby bench_erubis_slim_haml.rb | |
Rehearsal --------------------------------------------------------------------------------------- | |
empty loop 0.000000 0.000000 0.000000 ( 0.001055) | |
erubis 2.690000 0.000000 2.690000 ( 2.697228) | |
slim 4.200000 0.010000 4.210000 ( 4.196183) | |
haml 3.1.0.alpha.14 (Bleeding Edge) 19.660000 0.040000 19.700000 ( 19.681350) | |
haml (ugly) 3.1.0.alpha.14 (Bleeding Edge) 18.940000 0.070000 19.010000 ( 19.004186) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem 'sprockets' | |
gem 'sprockets-sass' | |
gem 'sass' | |
gem 'compass' | |
gem 'bootstrap-sass' | |
gem 'handlebars_assets' | |
gem 'coffee-script' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module BacktickAttributeSyntax | |
extend self | |
# WARNING: this is a dangerous hack. Don't use it. It'll bite you if you ever | |
# accidentally call backticks outside of a model. | |
# Override backtick syntax to return an Arel attribute for use with | |
# predications like `.gteq` in the model. To use the original shell | |
# behaviour, (which should be very uncommon in ActiveRecord models), you can |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fib(n)a,b,s=0,1,[];n.times{s<<a;a,b=b,a+b};s end | |
p fib(33) | |
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, ...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Git commit-msg hook. If your branch name is in the form "t123", automatically | |
# adds "Refs #123." to commit messages unless they mention "#123" already. | |
# Include "#close" or "#finish" to add "Closes #123." | |
# | |
# For Pivotal Tracker, branch names like "s123" adds "[#123]". | |
# Include "#close" or "#finish" to add "[Finishes #123]". | |
# | |
# If you include "#noref" in the commit message, nothing will be added to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include Rails.application.routes.url_helpers | |
default_url_options[:host] = "localhost" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Git needed for Git based gems | |
packages: | |
yum: | |
git: [] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
# - a browser with WebSocket support | |
# | |
# Usage: | |
# ruby redis_pubsub_demo.rb | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
top10Salaries :: FilePath -> IO () | |
top10Salaries path = do | |
Just (h, t) <- uncons . T.lines <$> T.readFile path | |
let | |
split = T.splitOn "," | |
Just ind = elemIndex "Salary" $ split h | |
top10 :: [Int] = t | |
& map (\s -> read $ T.unpack $ split s !! ind) | |
& sortBy (flip compare) | |
& take 10 |
OlderNewer