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.
Mocks and stubs in Test::Unit when you are used to RSpec
Test::Unit lacks built-in mocks and stubs; Mocha adds them and maps common RSpec double, stub, and expectation patterns to mock, stubs, and expects.
Find records with a Range condition
Use a Range in ActiveRecord conditions to query between two values, not just match lists; scopes built on condition hashes work with ranges too.
Directly search makandra notes from the Firefox address bar
Firefox can search makandra notes directly from the address bar by adding the site search to a keyword shortcut.
Alternative to url_for's deprecated :overwrite_params option
Rails 2.3.10 deprecation warning for url_for :overwrite_params when generating links with replaced query values. params.merge supplies the full parameter set and avoids the warning.
Output the descriptions of RSpec examples while they are running
RSpec’s nested documentation format prints example descriptions while specs run, making warnings and failures visible immediately and giving a quick view of core behavior.
Speed up response time in development after a Sass change
Large Sass files delay the first request after edits because CSS is compiled on demand; watching files and compiling ahead of time removes the startup lag.
Delete all MySQL records while keeping the database schema
Clear MySQL data without dropping tables, useful after bad migrations or frozen tests. DatabaseCleaner truncation keeps the schema intact and can be wrapped in a Rake task.
Synchronize a Selenium-controlled browser with Capybara
Selenium actions can return before a page finishes loading, so Ruby updates may race with browser-side changes. A Capybara resynchronization step prevents flaky Cucumber features.
Monitoring Theory
Around the time in my life when I stopped ordering drinks made with more than one ingredient, I was woken up for the last time by a hypochondriac Nagios monitoring installation. If you are on-call long enough, you cultivate a violent reaction to the sound of your cell phone's text message alert. If your monitoring is overconfigured, that reaction boils over hastily, as it will interrupt you during meals, sex, sleep — all of the basics — with the excruciating operational details of your web site.
I've since developed, with the help of some n...
plus2/whereuat - GitHub
Adds a slide out panel to your Rails application that directs clients to test stories that have been marked as 'delivered' in Pivotal Tracker.
Prevent floating sibling elements from wrapping in CSS
Floating sibling blocks line up horizontally but wrap at the container edge; a very wide inner wrapper keeps them on one line without visible overflow.