Skip to content

Instantly share code, notes, and snippets.

View sschober's full-sized avatar

Sven Schober sschober

  • Siemens Logistics GmbH
  • Nuremberg
View GitHub Profile
@sschober
sschober / autovivi.pl
Created November 1, 2014 18:12
Looking at things changes things...
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 July 21, 2014 12:46
SSLSocket.pm - A perl wrapper for the standard Thrift::Socket
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 February 3, 2014 14:43
RoleA requiring method provided by RoleB - Moose-Version (works)
use v5.14;
use strict;
use warnings;
package RoleA;
use Moose::Role;
requires 'm1';
sub m2() {
my $self = shift;
@sschober
sschober / roletest.pl
Created February 3, 2014 14:36
RoleA requiring method provided by RoleB - Moo-Version (works)
use Moops;
role RoleA {
requires 'm1';
method m2() {
$self->m1." World!\n";
}
}
role RoleB {
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 December 3, 2013 17:35
Symlinking is broken for me (cannot find `/opt/java/bin`, if no version of jdk is installed already).
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 November 12, 2013 14:18
Extrahiert timestamp und localtime aus `UUID`
#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 08:52
Changes to sundown PKGBUILD to enable third-party development
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 15:37
Examin signal delivery behavior in perl
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 13:09
Test delayed signal delivery in perl
use warnings;
use strict;
use POSIX qw(:signal_h);
my $sigset = POSIX::SigSet->new(SIGHUP);
my $oldset = POSIX::SigSet->new;
my $counter = 0;