Skip to content

Instantly share code, notes, and snippets.

package My::App;
use 5.010;
use Moose;
use strict;
use warnings;
use MooseX::HasDefaults::RO;
has [qw( foo bar )] => (
isa => 'Int',
required => 1,
770
404
718
203
901
305
312
313
215
803
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
$Data::Dumper::Deparse = 1;
# syntactic sugar
sub NEXTVAL { $_[0]->() }
sub Iterator (&) { return $_[0] }
PRAGMA foreign_keys = ON;
BEGIN TRANSACTION;
DROP TABLE IF EXISTS server;
CREATE TABLE server (
id INTEGER PRIMARY KEY,
name VARCHAR UNIQUE,
notes VARCHAR
);
@three18ti
three18ti / truth_in_values.pl
Last active December 20, 2015 21:39
Truth test perl
#!/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 );
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')
This is an experimental installer for WebGUI8 that attempts to use the
system package manager rather than the WRE.
It is currently incomplete -- it doesn't set up WebGUI or MySQL to run
at boot time, and it doesn't set up cron, and a few other things.
It uses a Curses interface, asking the user about install options
(paths and passwords and such), and getting confirmation before running
commands.
class { "authorized-sshkey::root":
authorized_keys => {
[
{
method => "ssh-rsa",
key => "asdf",
user => "jon@red5",
},
# {
# method => "ssh-dsa",
package App::SmarterMail::Parser::Thread;
use 5.014;
use Moose;
has 'thread_id' => (
is => 'rw',
isa => 'Int',
);
#!/usr/bin/perl
use 5.014;
use Tie::IxHash;
use Data::Dumper;
my $smartermail_directory = './Prime/';
my $search_string = 'jason@primelogisticsint.com';
# storage vars