Skip to content

Instantly share code, notes, and snippets.

@masaki
masaki / gist:3698917
Created September 11, 2012 14:17 — forked from cfcosta/gist:1149139
Implementation of Webrat's #table_at for using with Capybara. Not the cleanest implementation ever, but it works correctly.
def table_at(selector)
Nokogiri::HTML(page.body).css(selector).map do |table|
table.css('tr').map do |tr|
tr.css('td').map { |td| td.text.strip }
end
end[0].reject(&:empty?)
end
@masaki
masaki / mqh_install.sh
Created December 11, 2011 15:09 — forked from xaicron/mqh_install.sh
Installing MySQL5.1 / Q4M / HandlerSocket
#!/bin/sh
if [ `which perl` = "/usr/bin/perl" ]; then
echo -n -e "\e[1;31mUSING SYSTEM PERL OK? [y/n]\e[m: "
read ANSWER
if [ "$ANSWER" != "y" ]; then
exit 255
fi
PERL_CPANM_OPT="$PERL_CPANM_OPT --sudo"
fi
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin::libs;
use YAML;
use Sniffer::RTMP;
my $dev = $ARGV[0] or die 'require device name';