Skip to content

Instantly share code, notes, and snippets.

View wki's full-sized avatar
🏠
Working from home

Wolfgang Kinkeldei wki

🏠
Working from home
  • Erlangen, Germany
View GitHub Profile
#r "paket:
nuget Fake.Core.Target
nuget SSH.NET //"
#load "./.fake/build.fsx/intellisense.fsx"
module Ssh =
open Renci.SshNet
open Fake.Core
@wki
wki / install_modules.sh
Created May 10, 2012 19:44
install perl modules from carton.lock file
#!/bin/bash
#
# simple carton.lock based module installer script
# assumes that cpanm is installed natively for the perl used
#
# carton is not fully usable yet.
# One failing example is DBD::Pg.
# Reason: carton does not like "v2.19.2" version strings
#
@wki
wki / result_source_example.pl
Created April 25, 2012 19:23
DBIx::Class manipulating result source
package Schema::Result::Alarm;
use Moose;
use MooseX::NonMoose;
use MooseX::MarkAsMethods autoclean => 1;
extends 'DBIx::Class::Core';
__PACKAGE__->table_class('Schema::ResultSource::Alarm');
__PACKAGE__->table("alarm");
@wki
wki / multi_pdf.pl
Created April 1, 2012 18:08
create single PDF from many .pod or .pm files
#!/usr/bin/env perl
use Modern::Perl;
BEGIN {
if (@ARGV != 2) {
print STDERR "usage: $0 DIR OUTPUT\n";
exit 1;
}
}
@wki
wki / await_defer.pl
Created January 31, 2012 20:38
await - defer demo
#!/usr/bin/env perl
use strict;
use warnings;
use feature ':5.10';
use AnyEvent;
our $await_info;
sub on_timeout {
my ($timeout, $code) = @_;
@wki
wki / redis_benchmark.pl
Created January 29, 2012 08:53
Redis Binding Benchmark
#!/usr/bin/env perl
use strict;
use warnings;
use feature ':5.10';
use Redis;
use YAML::XS ();
use YAML ();
use JSON::XS ();
use IO::Socket::INET;
use Data::Dumper;
@wki
wki / css_parser.pl
Created December 22, 2011 19:48
Sample CSS Parser using Marpa::XS
use strict;
use warnings;
use feature ':5.10';
use Marpa::XS;
use Data::Dumper;
#
# a simple CSS snippet for testing
#
my $text = q{
@wki
wki / gist:340590
Created March 22, 2010 22:07
my first 2-html html::zoom thing
#!/usr/bin/perl
use strict;
use warnings;
use HTML::Zoom;
my $html = <<HTML;
<html>
<head>
<title>Hello people</title>
</head>
@wki
wki / gist:334969
Created March 17, 2010 06:12
Just a simple Catalyst Debugger
# real location of this library:
# /some/perl-search/path/Devel/CatDebug.pm
#
# debug your application like this:
# $ PERL5LIB=./lib perl -d:CatDebug ./script/name_or_your_app_server.pl
#
package DB;
our $stack_depth = 0;
our $must_show = 0;