Skip to content

Instantly share code, notes, and snippets.

@phluks
phluks / gist:1758245
Created February 7, 2012 08:27
Mojo - add condition
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 September 4, 2012 07:52
Where is the other git-ref?
# 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:3938301
Created October 23, 2012 11:35
Perl AnyEvent: How to make async calls in a loop - oh, this seems to work.
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 / gist:3938283
Created October 23, 2012 11:27
Perl AnyEvent: How to make async calls in a loop?
#!/usr/bin/perl
use strict;
use warnings;
use v5.10;
use AnyEvent;
use AnyEvent::Util;
# OBS: This doesn't work!
@phluks
phluks / test-dk-hyphen.pl
Last active December 13, 2015 21:29
Forsøg på dansk orddeling med TeX::Hyphen::Pattern
#!/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 December 20, 2015 08:49
Tripping up the mojo router
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: