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 warnings; | |
| use MojoX::Redis; | |
| my $redis1 = MojoX::Redis->new(); | |
| $redis1 | |
| ->sadd ( "set1" => "foo" ) |
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
| severity = 1 | |
| verbose = 5 | |
| exclude = CodeLayout::RequireTidyCode Miscellanea::RequireRcsKeywords Modules::RequireVersionVar ValuesAndExpressions::ProhibitInterpolationOfLiterals ValuesAndExpressions::ProhibitConstantPragma ErrorHandling::RequireCheckingReturnValueOfEval RegularExpressions::RequireDotMatchAnything RegularExpressions::RequireLineBoundaryMatching RegularExpressions::RequireExtendedFormatting Variables::ProhibitPackageVars Modules::ProhibitExcessMainComplexity ValuesAndExpressions::ProhibitEmptyQuotes ControlStructures::ProhibitUnlessBlocks Variables::ProhibitPunctuationVars |
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
| lwp-request http://127.0.0.1:8000/series/Sb6Adoxm2d?from=2 | json_xs | |
| [ | |
| { | |
| "timestamp" : "1970-01-01 00:00:02Z", | |
| "value" : 2, | |
| "series_id" : "Sb6Adoxm2d" | |
| }, | |
| { | |
| "timestamp" : "1970-01-01 00:00:03Z", | |
| "value" : 3, |
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
| rebar eunit skip_deps=true | |
| ==> probix (eunit) | |
| Compiled src/probix_db_mongo.erl | |
| Compiled test/probix_http_tests.erl | |
| ======================== EUnit ======================== | |
| module 'probix_http' | |
| module 'probix_http_tests' | |
| probix_http_tests:67: generate_basic_rest_tests...[0.036 s] ok | |
| probix_http_tests:71: generate_basic_rest_tests...[0.040 s] ok | |
| probix_http_tests:75: generate_basic_rest_tests...[0.004 s] ok |
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
| my $next_date = $report->{start_date}; | |
| my $interval = ''; | |
| if ( $report->{reccurence} eq 'daily' ) { | |
| $interval = 'DAY'; | |
| } elsif ( $report->{reccurence} eq 'weekly' ) { | |
| $interval = 'WEEK'; | |
| } else { | |
| $interval = 'MONTH'; | |
| } | |
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
| my $users_sth = $self->app->dbh->prepare("SELECT | |
| u.fullname, tu.user_type | |
| FROM | |
| report_template_users tu | |
| JOIN | |
| users u | |
| ON tu.user_id = u.id | |
| WHERE report_template_id = ?"); | |
| $users_sth->execute($row->{id}); | |
| my @users; |
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
| % layout 'default', page_title=>'Администрирование'; | |
| <%= include 'admin/menu', active => 'reports' %> | |
| <h2>Список отчетов</h2> | |
| <% for my $report ( @$reports ) { %> | |
| <h3> <%= $report->{name} %> </h3> | |
| <% } %> | |
| <a href="<%= url_for 'add_report' %>">Добавить отчет</a> |
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
| # Routes | |
| my $r = $self->routes; | |
| $r->route('/intra/login')->via('get')->to('auth#login')->name('login'); | |
| $r->route('/intra/login')->via('post')->to('auth#login_post')->name('post_login'); | |
| $r->route('/intra/logout')->via('get')->to('auth#logout')->name('logout'); | |
| my $auth = $r->bridge('/intra')->to('auth#check_auth'); | |
| $auth->route('/main')->to('main#index')->name('main'); | |
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
| #!perl | |
| use strict; | |
| use warnings; | |
| use DateTime; | |
| use Data::Dumper; | |
| use DateTime::Format::Strptime; | |
| my $p = DateTime::Format::Strptime->new(pattern => '%F %T', | |
| time_zone => 'local'); |
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
| class StompClient extends Stomp | |
| { | |
| var $config; | |
| var $server; | |
| var $failover_servers; | |
| public function __construct() { | |
| global $HP; | |
| $config_string = file_get_contents($HP['topdir']."/conf/activemq.json"); |