I can’t speak for you, but where I can, I like to use CoffeeScript because: it makes my life easier […]
Category: Ruby
redirect_to, array and the splat operator
I was wondering if there were a way to make this controller code more readable: events_controller.rb format.zip do if @event.zip_cache_up_to_date? […]
Kill Rails Server
If you have rails server running locally and need to kill it fast, I use this function: stop() { kill […]
Run Arbitrary Tests in Rails
A BASH script to run arbitrary tests: https://gist.github.com/3352560/ Original blog post: http://wordsanddeeds.posterous.com/run-arbitrary-tests-in-rails [Update:] I have moved this to its own […]
No such file or directory –rubygems
I faced it in jruby on rvm. Solution: echo “source $HOME/.rvm/scripts/rvm” >> ~/.bash_profile Or: echo “source $HOME/.rvm/scripts/rvm” >> ~/.bashrc
Use binstubs to speed up boot time if your on JRuby
With bundler’s binstubs, running “bundle exec” will not spawn a new JVM every time. To install $ chmod +x $rvmpath/hooks/aftercd_bundler […]
Build Ruby w/ GCC
Over time I’ve installed various versions of Xcode, Kenneth Reitz’s OSX GCC Installer and now Apple’s Command Line Tools. Unfortunately, […]
Extract time and time intervals from strings
Small library that helps you parse a string and get information about time patterns in it. It parses next patterns: […]
Rails 5.1 + Whenever gem + AWS Elastic Beanstalk – config file for 2018
Ok so as many others did before me, I just spent way too long trying to get the whenever CLI […]
Private Gem server
During a relax time at a conference I heard someone speaking about private gems servers. I had been wondering about […]
Tagging in Git with Ruby
#!/usr/bin/env ruby puts ‘Tag version?’ tag = gets.chomp tag = “v#{tag}” unless tag[0] == ‘v’ `git commit -m ‘Bump version […]
Conhecendo o Ruby: Diferença entre include e extend
Quando falamos de módulos no Ruby, include e extend são usados para adicionar funcionalidades de um módulo em uma determinada […]
Ruby Regexp: A, z, ^ and $
string = “my dog isn5 years old” string[/Ad+/] # match a sequence of digits at the start of the string […]
Mac? Rails 1.9.3? segfault in sqlite 1.3.6? Here’s a weird answer…
I ran into one of those brickwalls when I tried to run our latest-and-greatest web app. It had just switched […]
Fix UTF8 “problem” on Heroku w/ jRuby
If you use Heroku with 3rd party build pack (https://github.com/jruby/heroku-buildpack-jruby) to get jRuby up – you might have problems with […]
Rails Session Store domain: :all bug
If you are using Redis Store (or any non-cookie storage) for your Rails sessions and you’ve got a nasty bug […]
Dumper – The image dumper
With dumper, you can download whole image galleries of the most popular boards. It’s provided with many modules, including 4chan, […]
What is new in Rails 5? (Features + Changes)
API only application ActionCable Turbolink 3 rails for rake commands Ruby 2.2.1+ support Performance Improvements See the full article @ […]
Sublime, RVM and RubyTest
It took me a while to solve how to best run RSpec (and other tests) while using RVM in Sublime. […]
Use a rake task to describe your Test::Unit tests
I’ve been considering switching to RSpec / BDD for my Rails projects, but after thinking about it I realized that […]