Skip to content

Instantly share code, notes, and snippets.

View rafl's full-sized avatar

Florian Ragwitz rafl

View GitHub Profile
@rafl
rafl / Sugar.pm
Created March 11, 2009 11:10 — forked from pdcawley/Sugar.pm
# Devel::Declare::Sugar
package Test::Class::Sugar;
use Modern::Perl;
use Devel::Declare ();
use Devel::Declare::Context::Simple;
use Carp qw/croak/;
@rafl
rafl / Lite.pm
Created July 29, 2009 07:29 — forked from dhoss/Lite.pm
package WMC::Server::Lite;
use Moose;
use HTTP::Server::Simple;
use IO::Socket::SSL;
use IO::File;
use Regexp::Common qw /URI/;
use DateTime;
use File::Spec;
use Log::Dispatch::Syslog;
$self->process_form($ctx, 'Scheduling::Waitlist' => {
available_locations => [$ctx->model('DB::Location')->all],
available_events => [$ctx->model('DB::Experience')->all],
init_object => {
location => $waitlist->location->id,
event => $waitlist->experience->id,
notes => $waitlist->note,
},
on_success => fun ($form) {
...
hello:
goodbye:
main train station: Hauptbahnhof
airport: Flughafen
thank you: danke
please:
excuse me (I'm sorry for spilling your beer):
excuse me (get out of my way):
excuse me (give me your attention):
one:
Added EDENC to co-maintainers of Acme::CPANAuthors::German.
Added EDENC to co-maintainers of App::Software::License.
Added EDENC to co-maintainers of Audio::File.
Added EDENC to co-maintainers of Audio::File::AudioProperties.
Added EDENC to co-maintainers of Audio::File::Flac.
@rafl
rafl / elasticsearch_cache
Created March 22, 2012 16:32
Munin ElasticSearch plugins
#!/usr/bin/env perl
# Parameters supported:
#
# config
# autoconf
#
# Magic markers:
#%# family=auto
#%# capabilities=autoconf
{"phase":1,"error":"timeout","input":"{struct,[{<<\"save_method\">>,<<\"click_save\">>},{<<\"statusDisplayShort\">>,<<\"Sent to Fulfillment\">>},{<<\"return_date\">>,{struct,[{<<\"notes\">>,{struct,[{<<\"external\">>,<<>>},{<<\"internal\">>,<<>>}]}},{<<\"date\">>,<<\"2013/04/12\">>}]}},{<<\"_id\">>,<<\"81DC1590-76D8-11E2-A3E2-30A195B82C6E\">>},{<<\"opportunity_id\">>,<<\"006c0000003MdXCAA0\">>},{<<\"freightTotal\">>,<<\"0\">>},{<<\"opportunity_name\">>,<<\"Bruce Springsteen 2013\">>},{<<\"frequency\">>,<<\"daily\">>},{<<\"consumableTotal\">>,<<\"500000\">>},{<<\"prep_da...\">>,...},...]}","type":"exit","stack":"[{riak_kv_w_reduce,\'-js_runner/1-fun-0-\',3},{riak_kv_w_reduce,reduce,3},{riak_kv_w_reduce,maybe_reduce,2},{riak_pipe_vnode_worker,process_input,3},{riak_pipe_vnode_worker,wait_for_input,2},{gen_fsm,handle_msg,7},{proc_lib,init_p_do_apply,3}]"}
WITH notes AS (
SELECT n.note_id, n.created_by, n.note_content, n.revision_number, t.tag
FROM gphat.marker_notes AS n
LEFT OUTER JOIN gphat.marker_note_tags AS t
ON t.note_id = n.note_id AND t.created_by = n.created_by
WHERE n.marker_id = ? AND n.created_by = ?
), photos AS (
SELECT p.photo_id, p.created_by, mimetype(p.image_content) as mime_type,
p.revision_number, t.tag
FROM gphat.marker_photos AS p
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCchWGpIvLRFZp+RqeoL/IiVZF7OCXkM5npLIKBRiA4y0Eof4jONIFshM3LN0BJGhC2G4Dgz+sF/47x5VhOd/klodhmkbGjORLIvme7AceTJKvKuOa7e67x/tU583Ew54DSpOFPJiNsb9/pCeRIStyooTmIZgtu3YWNOzfJz2YD2gCRUtw2KXrJAnHVxUYEOILEcITBaNYyMR/4TPcyQjBSNzjJfAFfgNAUBEL7vIZYmLIAf+j2mG1KcwZWK5UjWFEvoeeQXnMswAS+/FQeQvcWEN2DY9nWoiSUk67+qYJsKDpH1de4HRKipl76ry7U8HiH2oKIR6Us0QaEpxnW8Y3J
| note_id | revision_number | marker_id | content |
+---------+-----------------+-----------+---------+
| 1 | 1 | 1 | foo |
| 2 | 1 | 1 | bar |
| photo_id | revision_number | marker_id | filename |
+----------+-----------------+-----------+----------+
| 1 | 1 | 1 | foo.jpg |
| 2 | 1 | 1 | bar.jpg |