Skip to content

Instantly share code, notes, and snippets.

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';
}
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
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,
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
#!/usr/bin/env perl
use strict;
use warnings;
use MojoX::Redis;
my $redis1 = MojoX::Redis->new();
$redis1
->sadd ( "set1" => "foo" )
package Foo;
## моя статистика
our $stats = {};
sub new {
return bless {}, shift;
}
$SIG{INT} = sub {
@sinkovsky
sinkovsky / test.pl
Created February 28, 2012 14:53 — forked from anonymous/test.pl
package Father;
$VERSION = "0.01";
sub new {
my $self = {};
bless $self;
return $self;
};
{
"keys": [
"perl_to_php_testkey",
"php_to_perl_testkey",
"php_to_perl_compressed_testkey"
],
"values": [
"this is a foo bar string", // string - just random string
42, // integer - answer to a question about universe
5.6, // float - nice apperture value :)
!perl
use strict;
use warnings;
my $ptr = 0;
my @tape = (0) x 5000;
my $op_idx = 0;
my @cmds;
@sinkovsky
sinkovsky / publicsuffix.erl
Last active December 19, 2015 15:38
Draft perl script to generate public suffix parsing part of domain name
#!perl
use strict;
use warnings;
open my $fh, "<", "publicsuffix.dat";
my $tree = {};
while (<$fh>) {