Quantcast
Channel: Lucas Caton - English posts
Browsing index pages (66 articles)
↧

How to run your feature specs using Capybara and Headless Chrome

Google has recently announced a way to run the Chrome browser in a headless environment. If you’re using Capybara gem, you can easily start using headless Chrome. Without further ado, let’s do it:1)...

View Article


How to setup multiple Heroku accounts (for heroku-cli)

Both Heroku and its CLI are great. However, there’s no way to access multiple accounts via terminal out of the box. If you have a personal and a work account and need an easy way to switch between...

View Article


[Ruby] How to get the name of the calling method?

I was about to run a rake task which would make important changes in my database. My code was similar to this:defmigrate_active_accountsaccounts=Account.active# Code to migrate accounts...

View Article

Image may be NSFW.
Clik here to view.

New blog theme

Last time I updated this blog’s theme was in 2012!It was about time to have a fresh new look and there you have it! \o/

View Article

Prevent Rails from writing development/test log files

I can’t remember the last time I needed to open/read log/development.log or log/test.log. These files usualy just consume disk space unnecessarily (some test.log files can easily reach more than 1...

View Article


Puma vs. Unicorn

TL; DR - Just use Puma.Rails has changed its default server from Webrick to Puma in Rails 5!It also supports Action Cable (one of the new features from Rails 5) and Basecamp said they’re using Puma in...

View Article

Rake task to import a production DB dump

Every now and then I need to write a script (rake task) to import a production database dump.This is code I usually use:require'yaml'namespace:dbdodesc'Downloads and imports a production DB...

View Article

Image may be NSFW.
Clik here to view.

Why I regenerated my SSH key and maybe you should too

I think we all agree it’s a good practice to regenerate your SSH key from time to time. Not sure about you, but the first thing that comes to my mind when I think about that is: it’d take forever to...

View Article


Image may be NSFW.
Clik here to view.

What is "frozen_string_literal" in Ruby?

Freezing Strings feature improves apps performance by freezing Strings. So, Matz - Ruby’s creator - decided to make all String literals frozen (immutable) by default in Ruby 3.0.In order to have a...

View Article


Image may be NSFW.
Clik here to view.

If you really need to create a monkey patch, do it properly

Sometimes we need to create a monkey patch for a gem or external lib. In these cases, it’s good to force it to fail if the gem has been bumped up. Let’s use Paperclip as an...

View Article

Image may be NSFW.
Clik here to view.

CampJS 2014 - the best geek event I ever attended

A few days ago I was in CampJS, the best geek event I ever attended.This is the official website (which is pretty cool by the way): http://campjs.com/.Why it was the best in my opinion:It happened at...

View Article

How to use command line on macOS

A friend of mine (who used to use Windows) has bought a Mac recently and he asked me how to use the command line on macOS:My answer was:99% of commands are identical in Linux. This is good news as...

View Article

Image may be NSFW.
Clik here to view.

What's on my macOS menu bar

ApplicationDescriptionTypeCaffeinePrevent your Mac from automatically going to sleep, dimming the screen or starting screen saversFree ColorSnapper Color pickerPaid1PasswordPassword...

View Article


Image may be NSFW.
Clik here to view.

An awesome Wiki built with Ruby and Rails!

I’ve been worked on a small open-source project. I’m talking about ruby_wiki, a simple wiki built with Ruby on Rails:If you’re interested, feel free to fork and contribute to the project.

View Article

Image may be NSFW.
Clik here to view.

Have a Rails 2 app? You can run it on the newest Ruby!

Do you have a legacy Rails application which is still running on Rails 2?There are several reasons to migrate your application to new Rails versions, like to improve the security, to be able to use a...

View Article


Image may be NSFW.
Clik here to view.

Interesting script written in Ruby: "The Globe"

I’ve just found this amazing Ruby script!In order to run it yourself, just create a Ruby file called a.rb with the following content:v=0000;eval$s=%q~d=%!^Lcf<LK8,...

View Article

Image may be NSFW.
Clik here to view.

Hellо, I am a compiler

I’ve found the following text here and thought it’d be nice to share it with you. Hope you enjoy it as much as I did :)Hellо, I am a compiler.I just scanned thousands of lines of code while you were...

View Article


Getting root permission to change a file without leaving Vim

You know when you open a file on Vim and after some changes you realise you’d need root permission to save the changes?I used to think that there isn’t other way other than:Copy the content of the...

View Article

Image may be NSFW.
Clik here to view.

A simple way to deploy your Rails applications

When I have a very simple Rails app, I avoid adding Capistrano or any other complex tool to deploy it.Instead, I use a simple shell script, which access the server via SHH and do what needs to be...

View Article

Image may be NSFW.
Clik here to view.

An easy way to split windows in Vim

There are several ways to split windows in Vim.This one is now my favorite:

View Article
Browsing index pages (66 articles)


Latest Images