Skip to content

Instantly share code, notes, and snippets.

View parkerl's full-sized avatar

Lew Parker parkerl

  • Rxrevu Inc.
  • Denver, CO, USA
View GitHub Profile
@parkerl
parkerl / legacy_firefox_for_selenium.md
Created January 20, 2012 22:19
Configuring selenium to use a legacy Firefox version in Rails applications.

Motivation

We recently were working on a project where the version of Firefox on the development machines was causing acceptance tests running on Capybara and Selenium to fail and/or hang erroneously. The solution was to point Selenium at a custom version of Firefox. We also added the Firefox binaries to the application git repo so that all devs could run against a known good version of Firefox.

Solution

  1. Download the desired version of Firefox from ftp://ftp.mozilla.org/pub/firefox/releases/

  2. Put Firefox.app in your rails app somewhere like ./bin/spec/macosx/

@parkerl
parkerl / yaml_dump
Created January 13, 2012 23:14
Dump objects to YAML in home directory
File.open(File.expand_path("~/objects.yml"),"w") {|f| f.puts(objects.to_a.to_yaml)}
@parkerl
parkerl / Filtered Log Tail
Created December 20, 2011 22:22
Here is a nice way to filter out debugging messages from a log file.
tail -f log/development.log | grep DEBUG
@parkerl
parkerl / gist:1479105
Created December 14, 2011 23:32
Iterate directories in bash
#!/bin/bash
src="/my/path"
for dir in `ls "$src/"`
do
if [ -d "$src/$dir" ]; then
fi
done
@parkerl
parkerl / gist:1479099
Created December 14, 2011 23:30
Find all symlinks below a given directory
ls -lR /path/to/folder | grep ^l