Liquid Canvas

Liquid Canvas is a JavaScript library which allows you to draw inside an HTML canvas element with an easy yet powerful description language.

It can be used to add graphics to your web page without ever touching an image creation tool such as The Gimp, Inkscape or Photoshop.

Check out the Demo and the basic example and then download version 0.3.

Fix "couldn't parse YAML" error after upgrading Bundler

Rails can fail to boot after a Bundler upgrade when the new YAML engine cannot handle symbol values in localization files.

Upgrade from Ruby 1.8.7 to Ruby 1.9.2 on Ubuntu

Upgrading Ubuntu from Ruby 1.8.7 to 1.9.2 can break Rails 2 apps using RSpec and removes installed gems, but Bundler can restore dependencies.

PhantomJS: Headless WebKit with JavaScript API

PhantomJS is a minimalistic headless WebKit.

It has fast and native support for various web standards:

DOM handling, CSS selector, JSON, Canvas, and SVG.

PhantomJS can be fully scripted using JavaScript. It is an optimal solution for headless testing of web-based applications, site scraping, pages capture, SVG renderer, PDF converter and many other usages.

Prevent an ActiveRecord attribute from being changed after creation

Changing a persisted association can leave cached counts inconsistent; freezing an ActiveRecord foreign key prevents updates that would otherwise require extra bookkeeping.

Touch records without running callbacks

ActiveRecord#touch updates updated_at but also triggers callbacks and validations, making frequent timestamp updates expensive. touch_gently and touch_all_gently refresh timestamps without callbacks.

Generate Puppet or Chef recipes from a Ubuntu system state

Blueprint inspects installed packages, changed config files, and locally built software to generate Puppet, Chef, or shell code from an Ubuntu system state.

Global variables in Ruby

List of global variables available to a Ruby script.

Upgrading Cucumber and Capybara to the latest versions available for Rails 2

Rails 2-compatible versions of Cucumber, Capybara, and related gems avoid breakage from newer dependencies and Capybara API changes.

Hide Thunderbird's buttons in message headers area

Remove the message-header buttons in Thunderbird 3 while keeping the existing header layout and right-side menu intact with a small userChrome.css tweak.

Onload callback for dynamically loaded images

Detects when a dynamically inserted image has finished loading so its dimensions are available. A jQuery load handler can fire reliably across browsers for this use case.

Skip Selenium scenarios in a Cucumber run

@javascript Cucumber scenarios run with Selenium and can slow down test runs; cucumber --tags ~@javascript skips them when needed.

Include existing PDF files into new TeX document

Insert existing PDF pages into a new LaTeX document without layout errors by using pdfpages and \includepdf.

Prohibit Git from merging .po-files

Git merges of .po files can create invalid gettext catalogs, especially with concurrent edits in branches. Treating them as binary avoids unsafe merge results.

Customize your Bash prompt

Bash prompt customization relies on PS1 escape sequences, colors, and command output to show user, host, directory, git branch, and status information.

state_machine 0.10.0 was released

Now allows to list transition paths from and to arbitrary states.

Apache: SSL with Virtual Hosts Using SNI

With SNI, you can have many virtual hosts with HTTPS sharing the same IP address and port, and each one can have its own unique certificate. SNI is supported by all major browsers except Internet Explorer on XP, Safari on XP, wget, Android and Java.

Cheats to optimize your web font rendering

Type looking a little flabby? Overweight? Want to give it a kick in the pants? Take a look at some of these tricks to really give your web type a workout.

Sanitize user-generated filenames and only send files inside a given directory

User-supplied filenames can escape a target directory and expose arbitrary readable files. A guarded send_file helper keeps downloads inside the intended path.

CSS3 Pie: Element not properly redrawn

PIE may fail to redraw nested elements when a parent class changes, leaving updated styles stale; changing the target element’s own CSS or markup works around it.

JavaScript Garden

JavaScript Garden is a growing collection of documentation about the most quirky parts of the JavaScript programming language. It gives advice to avoid common mistakes, subtle bugs, as well as performance issues and bad practices that non-expert JavaScript programmers may encounter on their endeavours into the depths of the language.

JavaScript Garden does not aim to teach you JavaScript. Former knowledge of the language is strongly recommended in order to understand the topics covered in this guide

RSpec matcher to check if an ActiveRecord exists in the database

Custom RSpec matcher verifies whether an ActiveRecord record still exists in the database after destruction or cleanup.

Setup (and secure) an SSH server on Ubuntu

Install and harden an SSH daemon on Ubuntu by adjusting sshd_config to block root logins, restrict users, and disable password authentication.

Common VIM commands

Core vim actions for editing text efficiently: window, buffer, navigation, search, clipboard and undo shortcuts plus syntax highlighting.