Skip to content

Instantly share code, notes, and snippets.

@masaki
masaki / gist:3698917
Created Sep 11, 2012 — forked from cfcosta/gist:1149139
Implementation of Webrat's #table_at for using with Capybara. Not the cleanest implementation ever, but it works correctly.
View gist:3698917
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 Dec 11, 2011 — forked from xaicron/mqh_install.sh
Installing MySQL5.1 / Q4M / HandlerSocket
View mqh_install.sh
#!/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
View rtmp connect dumper
#!/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';