Skip to content

Instantly share code, notes, and snippets.

View dnmfarrell's full-sized avatar

David Farrell dnmfarrell

View GitHub Profile
@dnmfarrell
dnmfarrell / reveal_presentation.md
Created September 13, 2014 13:27
A quick guide to markdown as served by the Perl module App::revealup

A quick guide to markdown as served by App::revealup
David Farrell
PerlTricks.com June 2014


This is H1

This is H2

This is H3

This is H4

@dnmfarrell
dnmfarrell / get_swift_code.pl
Created September 13, 2014 13:31
Perl script that downloads country SWIFT codes from www.bankswiftcode.org and outputs them in a pipe-delimited format
#!/usr/bin/env perl
# downloads country SWIFT codes from www.bankswiftcode.org and outputs them in a pipe-delimited format
# LICENSED Artistic License 2.0 http://opensource.org/licenses/Artistic-2.0
use strict;
use warnings;
use HTTP::Tiny;
use XML::LibXML;
die 'Please provide country' unless @ARGV;
@dnmfarrell
dnmfarrell / or.pl
Last active August 29, 2015 14:07
Script that sometimes generates an error
#!/usr/bin/env perl
# or.pl
# $ or.pl user@101.242.35.22
use strict;
use warnings;
use Object::Remote;
use Object::Remote::Connector::SSH;
use Eval::WithLexicals;
use strict;
use warnings;
use HTML::Entities;
use autodie;
# this program can be called with a filepath or a folder path containing
# files to clean
die 'Provide a filepath to clean' unless @ARGV or not -e $ARGV[0];
grammar foo
{
token TOP { ^ .* $ }
}
class bar
{
method TOP ($/)
{
say $/;
#!/usr/bin/env perl
use strict;
use warnings;
BEGIN { $SIG{INT} = $SIG{TERM} = sub { exit 0 } }
use Getopt::Long;
use Pod::Usage;
GetOptions (

An Introduction to tmux

Overview

  • Terminal multiplexer
  • Multiple terminals
  • Panes & windows
  • Maintains connections
  • Configurable
~/bugzilla-5.0.2 grep -rF ' WHERE ' Bugzilla
Bugzilla/Memcached.pm: $dbh->do("UPDATE profiles SET request_count=10 WHERE login_name=?", undef, $login);
Bugzilla/Memcached.pm: $dbh->do("UPDATE profiles SET last_activity_ts=? WHERE userid=?",
Bugzilla/Search.pm:# SELECT blah FROM blah WHERE ( (a1 OR a2)AND(b1 OR b2 OR b3)AND(c1)) AND (d1)
Bugzilla/Search.pm: WHERE $where
Bugzilla/Search.pm:# Internal Accessors: WHERE #
Bugzilla/Search.pm:# Note: There's also quite a bit of stuff that affects the WHERE clause
Bugzilla/Search.pm:# The terms that are always in the WHERE clause. These implement bug
Bugzilla/Search.pm:        return "$outer $not IN (SELECT DISTINCT $inner FROM $table WHERE $cond)";
@dnmfarrell
dnmfarrell / list-modules
Created March 10, 2016 17:32
Perl script to list all *pm files under a directory
#!/usr/bin/env perl
use 5.10.3;
use Path::Tiny 'path';
use Getopt::Long 'GetOptions';
GetOptions(
'dir=s' => \my $dirpath,
) or die "Unrecognized option\n";
die "--dir is required\n" unless $dirpath && -d $dirpath;
@dnmfarrell
dnmfarrell / build.log
Created June 17, 2016 17:49
cpanm MITHALDU/OpenGL-0.6704_05.tar.gz
cpanm (App::cpanminus) 1.7039 on perl 5.022000 built for x86_64-linux
Work directory is /home/dfarrell/.cpanm/work/1466185583.22703
You have make /usr/bin/make
You have LWP 6.15
You have /usr/bin/tar: tar (GNU tar) 1.28
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.