Skip to content

Instantly share code, notes, and snippets.

Avatar

Moritz Onken monken

View GitHub Profile
View Moose Hackathon Agenda.md

Moose Hackathon Agenda

This is a list of topics/ideas/wishes/dreams that we will discuss during the Moose hackathon at YAPC::NA this year. They are in no particular order, nor does inclusion of this list imply any type of endorsement of the idea, these are just ideas, so please feel free to add yours in.


  • Traits/Roles in Class::MOP
    • A low-level trait/role type primitive
  • removing Test::Exception from Moose/MOP
View gist:138067
$form->populate( {
auto_fieldset => { id => 'fs_login_form' },
elements => [
{ type => 'Block', tag => 'dl', elements => [
{ type => 'Block', content => 'Username', tag => 'dt' },
{ type => 'Block', tag => 'dd', elements =>
{ type => 'Text',
name => 'login_login',
constraints => [qw|Required|],
View gist:479448
package Foo;
use Moose;
use Test::More;
has foo => ( is => 'rw', lazy => 1, predicate => 'has_foo', default => 1 );
my $foo = new Foo;
ok($foo->has_foo); # fail
ok($foo->meta->get_attribute('foo')->has_value($foo)); # fail
ok($foo->foo); # ok
ok($foo->has_foo); # ok
View gist:824052
encode_json(
{ query => { term => { name => $module } },
size => 1,
sort => { date => { reverse => \1 } }
} );
View gist:856406
{
"release" : {
"_source" : {
"compress" : true
},
"properties" : {
"abstract" : {
"type" : "multi_field",
"fields" : {
"raw" : {
View gist:856409
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 2,
View gist:864574
# this doesn't work
curl -XDELETE http://localhost:9200/cpan
curl -XPUT http://localhost:9200/cpan -d '
{"analysis":{"analyzer":{"lowercase":{"filter":"lowercase","tokenizer":"keyword"}}},
"mappings":{"twitter":{"properties":{"name":{"type":"string","analyzer":"lowercase"}}}}}
'
# while this does:
View gist:866323
curl -XDELETE http://localhost:9200/test/;
curl -XPUT http://localhost:9200/test/;
curl -XPUT http://localhost:9200/test/foo/_mapping -d '
{
"tweet" : {
"properties" : {
"message" : {"type" : "string", "store" : "yes"}
}
View gist:868372
{
"cpan" : {
"dependency" : {
"_source" : {
"compress" : true
},
"properties" : {
"relationship" : {
"index" : "not_analyzed",
"store" : "yes",