This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| p.name, | |
| c.id as cliente_id, | |
| coalesce(cp.value, p.initial_value) as value | |
| FROM preferences p | |
| CROSS JOIN clientes c | |
| LEFT JOIN clientes_preferences cp ON cp.cliente_id = c.id AND cp.preference_id = p.id | |
| where c.id=180 and p.name='NOTIFY_COMMENTS_POSTS_CREATED'; | |
| /* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| p.name, | |
| c.id as cliente_id, | |
| coalesce(cp.value, p.initial_value) as value | |
| FROM preferences p, | |
| clientes c | |
| LEFT JOIN clientes_preferences cp ON cp.cliente_id = c.id AND cp.preference_id = c.id | |
| where c.id=180 and p.name='NOTIFY_COMMENTS_POSTS_CREATED'; | |
| /* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Mojo::Transaction::Role::PrettyDebug { | |
| use Mojo::Base -role; | |
| use Mojo::Util 'term_escape'; | |
| use DDP; | |
| use constant PRETTY => $ENV{TRACE} || $ENV{MOJO_CLIENT_PRETTY_DEBUG} || 0; | |
| after client_read => sub { | |
| my ($self, $chunk) = @_; | |
| my $url = $self->req->url->to_abs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $t->get_ok( | |
| '/me/audios/' . $event_id, | |
| {'x-api-key' => $session} | |
| )->status_is(200)->json_has('/audios/0/waveform', 'has waveform')->json_has('/audios/0/bytes', 'row 0 has bytes') | |
| ->json_is('/audios/0/id', $audio_1->id, 'row 0 is the right id') | |
| ->json_is('/audios/1/id', $audio_2_dup->id, 'row 1 is the right id') | |
| ->json_is('/audios/0/event_sequence', 1, 'row 0 is the right sequence') | |
| ->json_is('/audios/1/event_sequence', 2, 'row 1 is the right sequence') | |
| ->json_is('/audios/2', undef, 'row 2 does not exists') | |
| ->json_is('/audios/0/audio_duration', '16s', 'row 0 duration') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package TouchBase::Schema::ResultSet::Voucher; | |
| use common::sense; | |
| use Moose; | |
| use namespace::autoclean; | |
| extends 'DBIx::Class::ResultSet'; | |
| with 'TouchBase::Role::Verification'; | |
| with 'TouchBase::Role::Verification::TransactionalActions::DBIC'; | |
| with 'TouchBase::Schema::Role::ResultsetFind'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package TouchBase::Schema::ResultSet::Voucher; | |
| use common::sense; | |
| use Moose; | |
| use namespace::autoclean; | |
| extends 'DBIx::Class::ResultSet'; | |
| with 'TouchBase::Role::Verification'; | |
| with 'TouchBase::Role::Verification::TransactionalActions::DBIC'; | |
| with 'TouchBase::Schema::Role::ResultsetFind'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use strict; | |
| use warnings; | |
| use Benchmark qw/timethese cmpthese :hireswallclock/; | |
| use Redis; | |
| use Redis::hiredis; | |
| my $r2 = Redis->new; | |
| my $r = Redis::hiredis->new(); | |
| $r->connect( '127.0.0.1', 6379 ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sub test_callback { | |
| my $promise = Mojo::Promise->new(); | |
| my $req = Mojo::Message::Request->new; | |
| my $id = Mojo::IOLoop->server( | |
| { address => '127.0.0.1' } => sub { | |
| my ( $loop, $stream ) = @_; | |
| $stream->on( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use Mojo::Promise; | |
| use Mojo::IOLoop::Subprocess; | |
| use Mojo::UserAgent; | |
| my $subprocess = Mojo::IOLoop::Subprocess->new; | |
| $subprocess->run( | |
| sub { | |
| my $subprocess = shift; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package MojoX::InsistentPromise; | |
| use strict; | |
| use Carp; | |
| use Mojo::IOLoop; | |
| use Mojo::Promise; | |
| my @retry_timing = (0, 0.5, 1, 3, 7, 13, 21, 34, 55, 60, 120); | |
| use Scalar::Util 'weaken'; |