This file contains hidden or 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
#!/bin/sh | |
# hat tip to @consttype: https://twitter.com/#!/consttype/status/211035411026427904 | |
osascript -e 'tell application "iTunes" to pause' | |
x='tell application "iTunes" to get' | |
y='of current track as string' | |
say Title is `osascript -e "$x name $y"` . Author is `osascript -e "$x artist $y"` |
This file contains hidden or 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
#! perl | |
use strict; | |
use warnings; | |
use Test::More; | |
use MyTK::DB::SQL; | |
my $sql = MyTK::DB::SQL->new; | |
subtest '__build_from' => sub { |
This file contains hidden or 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 Test::More; | |
use Test::Deep; | |
## The ouput of a DBI querie with multiple nested join's | |
my @raw = ( | |
{ p1_id => 1, p1_n => 'a', p2_pa => 1, p2_pb => 1, p2_pn => 'p1', p3_s => 1, p3_sn => 's1' }, |
This file contains hidden or 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 v5.14; | |
use strict; | |
use Net::SSH2; | |
my $user = shift(@ARGV) || usage('Missing user'); | |
my $host = shift(@ARGV) || usage('Missing host'); | |
my $port = shift(@ARGV) || 22; |
This file contains hidden or 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
I expected the first configuration below, simple.conf, to work just fine. | |
But it doesn't. My app server receives the second hit with the same URI as the first hit. | |
On the second config, wtf.conf, I keep the original URL on a variable to use in the error redirect. | |
My question is this: why doesn't the first simple.conf configuration works? |
This file contains hidden or 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.014; | |
use warnings; | |
use Benchmark 'cmpthese'; | |
use Digest::CRC (); | |
use String::CRC32 (); | |
my $payload = 'a' x 1024; |
This file contains hidden or 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 E6::Setup::Class; | |
use :5.14; | |
use warnings; | |
use utf8; | |
use Moose (); | |
use MooseX::HasDefaults::RO (); | |
use MooseX::StrictConstructor (); | |
use MooseX::AttributeShortcuts (); | |
use Try::Tiny (); |
This file contains hidden or 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
Naturally the common people don't want war... but after all it is the | |
leaders of a country who determine the policy, and it is always a | |
simple matter to drag the people along, whether it is a democracy, or | |
a fascist dictatorship, or a parliament, or a communist dictatorship. | |
Voice or no voice, the people can always be brought to the bidding of | |
the leaders. That is easy. All you have to do is tell them they are | |
being attacked, and denounce the pacifists for lack of patriotism and | |
exposing the country to danger. It works the same in every country. | |
-- Hermann Goering, Nazi and war criminal, 1883-1946 |
This file contains hidden or 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
# My (almost) perfect perl tidy config file | |
-l=100 # Max line width is 100 cols - We are not on vt100 line terminals anymore | |
-i=2 # Indent level is 2 cols | |
-ci=2 # Continuation indent is 2 cols | |
-se # Errors to STDERR | |
-vt=2 # Maximal vertical tightness | |
-cti=0 # No extra indentation for closing brackets | |
-pt=2 # High parenthesis tightness | |
-bt=2 # High brace tightness |
This file contains hidden or 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
# the fpic is needed for mod_perl | |
# so is usesshrplib | |
# use 64bitall just makes sense as uselargefiles | |
# the ldflags mimic the settings of the system perl | |
perlbrew install -j 8 5.14.2 \ | |
-Dcccdlflags=-fPIC \ | |
-Duseshrplib \ | |
-Duse64bitall \ |