Rendering: repaint, reflow/relayout, restyle

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

Some insight into how browser rendering engines work. The article shows how the way you manipulate styles (and the DOM...

Materialized views with Sequel

Posted Over 9 years ago by Andreas Robecke.
matchingnotes.com

Sequel is an awesome ORM such as ActiveRecord. The linked article describes how easily you can implement and use materialized...

Getter and setter functions for JavaScript properties

Posted Over 9 years ago by Henning Koch.

JavaScript objects can have getter and setter functions that are called when a property is read from or written to...

Taking screenshots in Capybara

Posted Over 9 years ago by Thomas Klemm.
github.com

Capybara-screenshot can automatically save screenshots and the HTML for failed Capybara tests in Cucumber, RSpec or Minitest. Requires Capybara...

pgcli - Postgres command line interface

Posted Over 9 years ago by Thomas Klemm.
pgcli.com

A CLI for working with Postgres databases. Ships with auto-completion and syntax highlighting.

Active Record and PostgreSQL — Ruby on Rails Guides

Posted Over 9 years ago by Arne Hartherz.
edgeguides.rubyonrails.org

Rails guide that covers PostgreSQL-specific column types and usages for Active Record. You should especially keep in mind the...

CarrierWave: How to remove GIF animation

Posted Over 9 years ago by Arne Hartherz.

When accepting GIF images, you will also accept animated GIFs. Resizing them can be a time-consuming task and will...

AngularJS Performance in Large Applications

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

A lot of the advice involves less separations of concerns in your code ("don't use $watch", "don't use...

The Easiest Way to Parse URLs with JavaScript

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

A very clever hack to parse a structured URL object is to create a element and set its href to...

Vim: How to write a file you opened without sudo

Posted Over 9 years ago by Dominik Schöler.
stackoverflow.com

Have you ever opened a file with vim, edited it and when you wanted to save your changes it told...

How to combine "change", "up", and "down" in a Rails migration

Posted Over 9 years ago by Arne Hartherz.

Rails migrations allow you to use a change method whose calls are automatically inverted for the down path. However, if...

Using Passenger Standalone for development

Posted Over 9 years ago by Henning Koch.

For our production servers we use Passenger as a Ruby application server. While it is possible to use Passenger for...

AngularJS 1 Performance: One-time bindings in expressions

Posted Over 9 years ago by Thomas Klemm.
docs.angularjs.org

In addition to the {{ myValue }} two-way binding syntax, since Angular 1.3 there's a one-time binding syntax, prefixing...

Deterministic ordering of records by created_at timestamp

Posted Over 9 years ago by Thomas Klemm.

Creating records in specs can be so fast that two records created instantly after one another might have the same...

Tagging in Rails 4 using Postgres Arrays

Posted Over 9 years ago by Thomas Klemm.

class Document < ActiveRecord::Base scope :any_tags, -> (tags){ where('tags && ARRAY[?]', tags) } scope :all_tags, -> (tags){ where('tags @> ARRAY...

How Exchange handles multipart/alternative emails

Posted Over 9 years ago by Tobias Kraze.

In Rails, you can very easily send emails with HTML and plaintext bodies. However, if you're trying to debug...

Ubuntu: Fix "An error occurred while installing pg"

Posted Over 9 years ago by Henning Koch.

If you get an error like this: An error occurred while installing pg (0.17.1), and Bundler cannot continue.

Rspec: Complex argument expectations for should_receive

Posted Over 9 years ago by Tobias Kraze.

Sometimes you need complex expectations on method arguments like this SomeApi.should_receive(:find).with(:query => '*foo*', :sort => 'timestamp ASC', :limit...

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 Over 9 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 Over 9 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...