Skip to content

Instantly share code, notes, and snippets.

@phluks
phluks / gist:1758245
Created Feb 7, 2012
Mojo - add condition
View gist:1758245
Ah, I think I found out. I need to use a bridge for this.
# Can this be implemented with a Mojo-lite thingy?
# This is my problem:
sub startup {
my $self = shift;
# JSON Errors - you may want to uncomment for debug
#$self->controller_class("BIER::SERVICES::Errors::Json");
@phluks
phluks / git-ref-wth
Created Sep 4, 2012
Where is the other git-ref?
View git-ref-wth
# What refs do we have for release - one?
find .git/refs/ -name Release-2012.08.01
.git/refs/heads/Release-2012.08.01
# No two?
[olav@fern (Release-2012.08.01)]$ git show-ref | grep Release-2012.08.01
fc9b7ce40a00ab59248a2aaa4b8f0b6bb6864e85 refs/heads/Release-2012.08.01
fc9b7ce40a00ab59248a2aaa4b8f0b6bb6864e85 refs/remotes/origin/Release-2012.08.01
# Where's the second one? - not here:
@phluks
phluks / gist:3938283
Created Oct 23, 2012
Perl AnyEvent: How to make async calls in a loop?
View gist:3938283
#!/usr/bin/perl
use strict;
use warnings;
use v5.10;
use AnyEvent;
use AnyEvent::Util;
# OBS: This doesn't work!
@phluks
phluks / gist:3938301
Created Oct 23, 2012
Perl AnyEvent: How to make async calls in a loop - oh, this seems to work.
View gist:3938301
use AnyEvent;
use AnyEvent::Util qw"run_cmd";
sub f {
my($x) = @_;
warn "got (($x))\n";
};
for my $n (1..10) {
my $rand = int(rand(10));
@phluks
phluks / test-dk-hyphen.pl
Last active Dec 13, 2015
Forsøg på dansk orddeling med TeX::Hyphen::Pattern
View test-dk-hyphen.pl
#!/usr/bin/perl
use warnings;
use v5.10;
# Remember to save as utf8!
use utf8;
use TeX::Hyphen;
use TeX::Hyphen::Pattern;
use open ":locale";
@phluks
phluks / mojo-router-trip
Last active Dec 20, 2015
Tripping up the mojo router
View mojo-router-trip
I seem to be doing something that trips up the mojo router.
The intention is to make a service structured like this:
<url>/<app>/<controller>/
Apparantly the code "works". So I assume Im doing doing the Mojo-thing wrong. I suspect its easy to
spot the mistake in the "Setup" section.
The symptoms: