Skip to content

Instantly share code, notes, and snippets.

# Give it two procs to compare
def bm(o, n)
reload!
puts "Running 10 times"
Benchmark.bmbm(10) do |x|
x.report('Old Query:') { @olr = o.call }
x.report('New Query:') { @nr = n.call }
end
reload!
# Scenario:
# We run a youtube production company and we make videos for paying members.
# Paying members can likewise access paid for premium content, and guests can access free content.
# Pretty straight forward.
#
# Next Scenario:
# We decide, one day, to open source all of our content. All videos, text posts, tutorials, etc
# are now available to *all* users.
#
# What's the most optimal way to be able to ship such a feature, with all tests passing.

Moose Hackathon Agenda

This is a list of topics/ideas/wishes/dreams that we will discuss during the Moose hackathon at YAPC::NA this year. They are in no particular order, nor does inclusion of this list imply any type of endorsement of the idea, these are just ideas, so please feel free to add yours in.


  • Traits/Roles in Class::MOP
    • A low-level trait/role type primitive
  • removing Test::Exception from Moose/MOP
@dhoss
dhoss / mt.psgi
Created October 21, 2009 21:25 — forked from miyagawa/mt.psgi
#!/usr/bin/perl -w
use strict;
use lib $ENV{MT_HOME} ? "$ENV{MT_HOME}/lib" : 'lib';
use MT::Bootstrap ();
use MT::App::CMS;
use CGI::PSGI;
use Plack::Builder;
my $app = sub {
my $cgi = CGI::PSGI->new(shift);
@dhoss
dhoss / mt.psgi
Created November 2, 2009 20:49 — forked from miyagawa/mt.psgi
fix'd
#!/usr/bin/perl -w
use strict;
use lib $ENV{MT_HOME} ? "$ENV{MT_HOME}/lib" : 'lib';
use MT::Bootstrap ();
use MT::App::CMS;
use CGI::PSGI;
use Plack::Middleware qw(Static);
use Plack::Builder;
my $app = sub {
+my $cgi = new CGI;
-$app = $class->new( %param ) or die $class->errstr;
+$app = $class->new( %param, CGIObject => $cgi ) or die $class->errstr;
local $SIG{__WARN__} = sub { $app->trace($_[0]) };
+$app->init_request(CGIObject => $cgi);
$app->run;
## MAKE THIS A REAL FUCKING DIFF
@dhoss
dhoss / gist:239942
Created November 21, 2009 01:19 — forked from jhannah/gist:239941
open my $in, "oma_repl_language_text.sql";
open (my $out, ">:encoding(UTF-8)", "utf8.sql");
while (<$in>) {
print $out $_;
}
@dhoss
dhoss / gist:253513
Created December 10, 2009 17:42 — forked from jshirley/gist:253512
#!/bin/sh
# Start a Plack daemon.
PATH=/bin:/usr/bin:/sbin:/usr/sbin:$HOME/perl5/bin
DAEMON="$HOME/perl5/bin/plackup"
NAME="AppName"
CWD=`pwd`
# Defaults
RUN="no"
12:26 -!- screen_away: Set away
12:26 [ii] -!- You have been marked as being away
12:26 [oftc] -!- You have been marked as being away
12:26 [scsys] -!- You have been marked as being away
12:26 [MagNET] -!- You have been marked as being away
12:26 [freenode] -!- You have been marked as being away
12:26 [osx86] -!- You have been marked as being away
Day changed to 01 Jan 2010
Day changed to 02 Jan 2010
22:28 -!- screen_away: Reset away
@dhoss
dhoss / REST.pm
Created January 11, 2010 19:08 — forked from jshirley/REST.pm
package My::Base::REST;
use Moose;
BEGIN { extends 'Catalyst::Controller::REST'; }
use CGI::Expand qw/expand_hash/;
__PACKAGE__->config(
'default' => 'text/html',