Skip to content

Instantly share code, notes, and snippets.

@edipretoro
edipretoro / bootstrap-plugins.txt
Created October 21, 2012 08:42 — forked from mklabs/bootstrap-plugins.txt
h5bp + twitter bootstrap integration
bootstrap-tooltip.js
bootstrap-popover.js
bootstrap-alert.js
bootstrap-button.js
bootstrap-carousel.js
bootstrap-collapse.js
bootstrap-dropdown.js
bootstrap-modal.js
bootstrap-scrollspy.js
bootstrap-tab.js
@edipretoro
edipretoro / comment.pl
Created October 8, 2012 13:46 — forked from anonymous/comment.pl
HTML4 comment parsing issue with Mojo::DOM
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use Mojo::DOM;
use HTML::TreeBuilder;
my $content = <<'EOF';
<html>
<body>
@edipretoro
edipretoro / benchmark.pl
Created October 8, 2012 13:46 — forked from anonymous/benchmark.pl
Simple Mojo::DOM vs HTML::TreeBuilder comparison
#!/usr/bin/env perl
use strict;
use warnings;
use HTML::TreeBuilder;
use Mojo::DOM;
use Benchmark qw(:hireswallclock cmpthese);
use Template;
#! /usr/bin/perl -w
use strict;
use warnings;
use feature 'say';
use Data::Dump;
my %total_bytes;
while (<>) {
my ($source,$destination,$bytes) = split;
#!/usr/bin/perl
# Usage: upgrade-cpan.pl 5.14.0 | sort -u | cpanm
use strict;
use File::Find::Rule;
use JSON;
my $old = shift;
my @files = File::Find::Rule->file->name('install.json')->in("$ENV{HOME}/perl5/perlbrew/perls/perl-$old/lib/site_perl/$old");
for my $file (@files) {
-- CREATE STANDARD TABLES FOR LawDB.db
CREATE TABLE Law (
id integer primary key autoincrement,
content text not null,
lastdate date not null,
presc text
);
CREATE TABLE LawVersion (
lawid integer references Law(id),
@edipretoro
edipretoro / gist:2585815
Created May 3, 2012 13:56 — forked from SebDeclercq/gist:2585720
Error while running populate-db.pl
################ schema.sql ####################
# CREATE TABLE Law (
# id integer primary key,
# title text not null,
# lastdate date not null,
# auth text
# );
# CREATE TABLE LawVersion (
# lawid integer references Law(id),
# numid text primary key not null,
@edipretoro
edipretoro / perldoc-wordcloud.pl
Created March 25, 2012 15:25 — forked from rgs/perldoc-wordcloud.pl
A script to create word clouds from perl's core documentation
use strict;
use warnings;
use File::Slurp;
use Image::WordCloud;
for my $file (<perl*.pod>) {
my $text = `pod2text $file`;
my $wc = Image::WordCloud->new();
$wc->words($text);
my $gd = $wc->cloud();
$file =~ s/od$/ng/;