What we know about PDFKit

Posted Over 9 years ago by Henning Koch.
github.com

PDFKit converts a web page to a PDF document. It uses a Webkit engine under the hood...

Alternative for Ruby singletons

Posted Almost 10 years ago by Thomas Klemm.
ozmm.org

require 'net/http' module Cheat extend self # the magic ingredient def host @host ||= 'http://cheat.errtheblog.com/' end def http @http ||= Net...

What edge_rider offers you

Posted Almost 10 years ago by Dominik Schöler.
github.com

edge_rider is Power tools for ActiveRecord relations (scopes). Please note that some of the functions edge_rider provides have...

MySql lost connection trouble

Posted Almost 10 years ago by Andreas Robecke.
dev.mysql.com

Directly from the MySql docs: There are three likely causes for this error message. Usually it indicates network connectivity trouble...

terminator keyboard shortcuts

Posted Almost 10 years ago by Thomas Eisenbarth.
linux.die.net

When connecting to multiple (i.e. > 4) servers to dive into logfiles or do security updates, terminator is what you want...

assignable_values 0.11.0 can return *intended* assignable values

Posted Almost 10 years ago by Dominik Schöler.

As you know, assignable_values does not invalidate a record even when an attribute value becomes unassignable. See this example...

PSA: Umlauts are not always what they seem to be

Posted Almost 10 years ago by Arne Hartherz.

When you have a string containing umlauts which don't behave as expected (are not matched with a regexp, can...

Discarding cached SQL query results in ActiveRecord

Posted Almost 10 years ago by Thomas Klemm.

ActiveRecord caches results of SQL queries. If you want to discard the cached results for one model, you can call...

Retrieving the class an ActiveRecord scope is based on

Posted About 10 years ago by Henning Koch.

Edge Rider gives your relations a method #origin_class that returns the class the relation is based on.

What's new in edge Rails: Active Record enums

Posted About 10 years ago by Thomas Eisenbarth.
robots.thoughtbot.com

Declare an enum attribute where the values map to integers in the database, but can be queried by name.

Why Ruby Class Methods Resist Refactoring

Posted About 10 years ago by Henning Koch.
blog.codeclimate.com

Splitting a long method into sub methods is easier in instances since it is in classes. Since...

Why your previous developer was terrible

Posted About 10 years ago by Henning Koch.
medium.com

When you, as a developer, look at the choices used to build a particular application, you’re blown away at...

BrowserStack has browser plugins for local testing

Posted About 10 years ago by Thomas Eisenbarth.
browserstack.com

Local testing allows you to test your private and internal servers using the BrowserStack cloud, which has support for firewalls...

ActiveRecord: validate_uniqueness_of is case sensitive by default

Posted About 10 years ago by Tobias Kraze.

By default, Rails' validates_uniqueness_of does not consider "username" and "USERNAME" to be a collision. If you use MySQL...

Your Rails sandbox console

Posted About 10 years ago by Dominik Schöler.

Just found out about a great feature in Rails that seems to be around since Rails 2. Start a console...

Don't ever use the float type for database columns

Posted About 10 years ago by Henning Koch.

Like in any language, a FLOAT will eventually corrupt data due to rounding errors. Please use DECIMAL, which has well...

Using Arel to Compose SQL Queries

Posted About 10 years ago by Henning Koch.
robots.thoughtbot.com

Arel is a library that was introduced in Rails 3 for use in constructing SQL queries. Every time you pass...

[Openstack] "Failed to schedule_prep_resize: No valid host was found." when trying to resize an instance

Posted Over 10 years ago by Kim Klotz.

If you get this error while trying to resize an openstack instance: # nova resize fooinstance 16 --poll ==> /var/log/nova/nova-scheduler.log <==

Bash: Setting the title of your terminal tab

Posted Over 10 years ago by Dominik Schöler.

If your terminal has many tabs, you'll want to keep them organized. To change their title from the prompt...

How to load only a subset of a massive MySQL dump

Posted Over 10 years ago by Arne Hartherz.

I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...

Don't use "self" as a Javascript variable

Posted Over 10 years ago by Henning Koch.

You might sometimes use self to capture the context of this before it is destroyed by some function. Unfortunately self...

The new Modularity 2 syntax

Posted Over 10 years ago by Henning Koch.

We have released Modularity 2. It has many incompatible changes. See below for a script to migrate your applications automatically...

Careful with '||=' - it's not 'memoize'

Posted Over 10 years ago by Christoph Beck.

When you do something like this in your code: def var_value @var ||= some_expensive_calculation end

Threads and processes in a Capybara/Selenium session

Posted Over 10 years ago by Henning Koch.

TLDR: This card explains which threads and processes interact with each other when you run a Selenium test with Capybara...