View check_dbd2.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.010; | |
use warnings; | |
use strict; | |
use DBI; | |
use DBD::DB2; | |
say "Operating System = " . $^O; | |
say "Perl Binary = " . $^X; | |
say "Perl Version = " . $]; | |
say "DBI Version = " . $DBI::VERSION; |
View install.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Install all packages, including nodejs and npm (I always install build essential on dev machines, I've included it here for accuracy) | |
2) install grunt and compass | |
3) set environment variables | |
4) checkout calamari to /opt/workspace | |
5) create virtualenv | |
6) activate virtualenv (very important step I was missing on my first run through, it's implied but I'm not well versed in Python so it was definitely an "Ah ha!" moment) | |
7) use pip to install dependencies, the `pip install -r requirements/debian/requirements.force.txt` tends to complete with an already satisfied." but I continue to run it anyway. | |
8) Checkout calamari-clients to alternate directory | |
9) run make dist on calamari-clients directory | |
10) copy resulting contents to your webapp/contents directory (`make dist`, `make build-real`, or `make ui`, which is correct? there's a tarball that's involved somehow too... what's the deal with that?) |
View Bar.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Foo::Bar; | |
use strict; | |
use warnings; | |
1; |
View test.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.010; | |
use strict; | |
use warnings; | |
BEGIN { | |
eval { | |
require 'lib/Foo.pm'; | |
}; | |
print $@; |
View moose_design_pattern.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package My::App; | |
use 5.010; | |
use Moose; | |
use strict; | |
use warnings; | |
use MooseX::HasDefaults::RO; | |
has [qw( foo bar )] => ( | |
isa => 'Int', | |
required => 1, |
View song_acs.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
770 | |
404 | |
718 | |
203 | |
901 | |
305 | |
312 | |
313 | |
215 | |
803 |
View hop_iterators.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
$Data::Dumper::Deparse = 1; | |
# syntactic sugar | |
sub NEXTVAL { $_[0]->() } | |
sub Iterator (&) { return $_[0] } |
View ipdb_test.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PRAGMA foreign_keys = ON; | |
BEGIN TRANSACTION; | |
DROP TABLE IF EXISTS server; | |
CREATE TABLE server ( | |
id INTEGER PRIMARY KEY, | |
name VARCHAR UNIQUE, | |
notes VARCHAR | |
); |
View truth_in_values.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use 5.010; | |
%hash ? say "Empty Hash is true" : say "Empty Hash is false" ; | |
scalar keys %hash > 0 ? say "Empty Hash is true" : say "Empty Hash is false" ; | |
%hash = ( foo => 1, bar => 2 ); |
View gist:5485689
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import platform | |
import shutil | |
import cPickle | |
org_state_file_path = os.path.expanduser('~/.config/deluge/state/torrents.state') | |
new_state_file_path = os.path.expanduser('~/torrents.state.new') | |
state_file_org = open(org_state_file_path, 'rb') |
NewerOlder