Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use strict;
use warnings;
use DBI;
use File::Slurp;
use File::Basename;
use File::Next;
use Getopt::Long;
(defun manu/substr-repo-from-filename (string)
(interactive)
(substring
(expand-file-name string)
(length
(expand-file-name (vc-call-backend 'git 'root default-directory)))))
(defun manu/log-edit-insert-filenames ()
(interactive)
(insert "* " (mapconcat 'manu/substr-repo-from-filename (log-edit-files) ", ") ": "))
(defun toggle-fullscreen (&optional f)
(interactive)
(let ((current-value (frame-parameter nil 'fullscreen)))
(set-frame-parameter nil 'fullscreen
(if (equal 'fullboth current-value)
(progn
(setq left-margin 0)
(setq right-margin 0)
(set-window-margins (selected-window) left-margin right-margin))
(if (boundp 'old-fullscreen) old-fullscreen nil)
@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/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use myPKM::Schema;
use Lucy::Analysis::PolyAnalyzer;
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use myPKM::Schema;
use Lucy::Analysis::PolyAnalyzer;
#! /usr/bin/perl -w
use strict;
use warnings;
use feature 'say';
use Data::Dump;
my %total_bytes;
while (<>) {
my ($source,$destination,$bytes) = split;
use utf8;
package LawDB::Schema::Result::LawVersion;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
LawDB::Schema::Result::LawVersion