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 SugarTree; | |
=head1 NAME | |
SugarTree - Create datastructures with sugar | |
=head1 SYNOPSIS | |
use SugarTree; |
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; | |
sub foo { | |
my $res = ''; | |
warn "foo(): @_"; | |
(sub { |
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 IO::Socket::INET; use File::Basename; use File::Path; BEGIN { | |
our $SOURCE = $ENV{'AUTO_INSTALL_DEPS_SOURCE'} || 'http://api.metacpan.org:80/source/%s'; | |
our $LIB = "$ENV{'HOME'}/.perl5"; | |
push @INC, $LIB, sub { | |
my($module) = $_[1] =~ /(.*)\.pm$/; $module =~ s!/!::!g; | |
my($hostname) = $SOURCE =~ m!//([^/]+)!; | |
my $s = IO::Socket::INET->new(PeerAddr => $hostname) or die "Cannot download required library from $hostname: $@"; | |
File::Path::make_path(dirname "$LIB/$_[1]"); | |
open my $FH, '+>', "$LIB/$_[1]" or die "Write $LIB/$_[1]: $!"; | |
printf STDERR "GET $SOURCE HTTP/1.1\n", $module if $ENV{'AUTO_INSTALL_DEPS_DEBUG'}; |
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
#!/bin/sh | |
BACKUP=$GIT_DIR; # need to be first? | |
GIT_DIR="path/to/my/repo/.git"; | |
while read oldrev newrev refname; do | |
BRANCH=$(echo $refname | cut -f3 -d/); | |
echo branch $BRANCH | |
if [ "x$BRANCH" = "xalien" ]; then | |
cd $GIT_DIR; |
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
my $obj = B::svref_2object($code); | |
my $name = $obj->GV->NAME; | |
my $pkg = $obj->GV->STASH->NAME; | |
warn "The method name is $pkg\::$name"; |
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 Mojolicious::Lite; | |
# the params can be found at https://cloudinary.com/console | |
plugin cloudinary => { | |
api_key => '1234567890', | |
api_secret => 'your-super-s3cret', | |
cloud_name => 'your_cloud_name', | |
}; | |
# this need to be some sort of backend database |
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
[Desktop Entry] | |
Version=1.0 | |
Name=DC50 Nokia import | |
GenericName=Photo Manager for Nokia DC50 | |
Comment=Import your photos from Nokia DC50 | |
Exec=/usr/local/bin/shotwell-mounter %U | |
Icon=shotwell | |
Terminal=false | |
Type=Application | |
MimeType=x-content/image-dcf; |
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 { | |
our $bar = 123; | |
sub bar { 'hello' } | |
warn join ', ', keys %{ "Foo::" }; # bar | |
my $gv = ${ "Foo::" }{bar}; | |
my $scalar = *$gv{SCALAR}; | |
my $code = *$gv{CODE}; |
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
#!perl | |
qw/ | |
abs accept alarm atan2 bind binmode bless break caller chdir | |
chmod chomp chop chown chr chroot close closedir connect | |
continue cos crypt dbmclose dbmopen default defined delete die | |
do dump each endgrent endhostent endnetent endprotoent endpwent | |
endservent eof eval exec exists exit exp fcntl fileno flock fork | |
format formline getc getgrent getgrgid getgrnam gethostbyaddr | |
gethostbyname gethostent getlogin getnetbyaddr getnetbyname | |
getnetent getpeername getpgrp getppid getpriority getprotobyname |
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 Mojolicious::Lite; | |
my $connections = {}; | |
my $drawings = {}; | |
# demo here: http://whiteboard-jhthorsen.dotcloud.com/ | |
get '/' => sub { | |
my $self = shift; |
OlderNewer