Skip to content

Instantly share code, notes, and snippets.

@sschober
sschober / autovivi.pl
Created Nov 1, 2014
Looking at things changes things...
View autovivi.pl
use Modern::Perl '2012';
use Test::More;
use Data::Dumper;
my %hash = (
1 => undef
);
ok(! $hash{1}, 'Ok, undef unter Key 1 ist false');
is( ref($hash{1}), '', 'Ok, dort ist auch keine Referenz');
@sschober
sschober / SSLSocket.pm
Created Jul 21, 2014
SSLSocket.pm - A perl wrapper for the standard Thrift::Socket
View SSLSocket.pm
use Modern::Perl '2014';
use IO::Socket::SSL;
use Thrift;
use Thrift::Socket;
=head1 NAME
Thrift::SSLSocket - A SSL wrapper around the standard C<Thrift::Socket>
@sschober
sschober / roletest-moose.pl
Created Feb 3, 2014
RoleA requiring method provided by RoleB - Moose-Version (works)
View roletest-moose.pl
use v5.14;
use strict;
use warnings;
package RoleA;
use Moose::Role;
requires 'm1';
sub m2() {
my $self = shift;
@sschober
sschober / roletest.pl
Created Feb 3, 2014
RoleA requiring method provided by RoleB - Moo-Version (works)
View roletest.pl
use Moops;
role RoleA {
requires 'm1';
method m2() {
$self->m1." World!\n";
}
}
role RoleB {
View enable-logging.diff
diff --git a/bundles/com.eclipsesource.jaxrs.publisher/src/com/eclipsesource/jaxrs/publisher/internal/JerseyContext.java b/bundles
index 78636db..6e25f2b 100644
--- a/bundles/com.eclipsesource.jaxrs.publisher/src/com/eclipsesource/jaxrs/publisher/internal/JerseyContext.java
+++ b/bundles/com.eclipsesource.jaxrs.publisher/src/com/eclipsesource/jaxrs/publisher/internal/JerseyContext.java
@@ -13,11 +13,13 @@ package com.eclipsesource.jaxrs.publisher.internal;
import java.util.ArrayList;
import java.util.List;
+import java.util.logging.Logger;
@sschober
sschober / 0001-fix-symlinking-binaries.patch
Created Dec 3, 2013
Symlinking is broken for me (cannot find `/opt/java/bin`, if no version of jdk is installed already).
View 0001-fix-symlinking-binaries.patch
diff --git a/PKGBUILD b/PKGBUILD
index bc479d2..8ddd0bd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -66,7 +66,7 @@ package() {
mv * "$pkgdir"/opt/java/
msg2 "Symlinking the binaries"
- find /opt/java/bin -type f -exec ln -s {} "${pkgdir}"/usr/bin/ \;
+ find ${pkgdir}/opt/java/bin -type f -printf "%f\n" | while read file; do ln -s /opt/java/bin/$file "${pkgdir}"/usr/bin/; done
@sschober
sschober / time_from_uuid.c
Created Nov 12, 2013
Extrahiert timestamp und localtime aus `UUID`
View time_from_uuid.c
#include <uuid.h>
#include <stdio.h>
#include <time.h>
int main(int argc, char** argv){
if(argc<2) return 1;
uuid_t uuid;
if( uuid_parse(argv[1],uuid) < 0 ){
return 1;
@sschober
sschober / 0001-enable-third-party-development.patch
Created May 16, 2012
Changes to sundown PKGBUILD to enable third-party development
View 0001-enable-third-party-development.patch
diff --git a/PKGBUILD b/PKGBUILD
index 19bc728..2a7f90c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
# Maintainer: Your Name <youremail@domain.com>
pkgname=sundown-git
-pkgver=20110815
+pkgver=20120516
@sschober
sschober / sigtest.pl
Created May 15, 2012
Examin signal delivery behavior in perl
View sigtest.pl
use warnings;
use strict;
use POSIX qw(:signal_h);
my $sigset = POSIX::SigSet->new(SIGCHLD);
my $oldset = POSIX::SigSet->new;
my $counter = 0;
@sschober
sschober / sigtest.pl
Created May 15, 2012
Test delayed signal delivery in perl
View sigtest.pl
use warnings;
use strict;
use POSIX qw(:signal_h);
my $sigset = POSIX::SigSet->new(SIGHUP);
my $oldset = POSIX::SigSet->new;
my $counter = 0;