Skip to content

Instantly share code, notes, and snippets.

View renatocron's full-sized avatar

Renato Santos renatocron

  • eokoe
  • Sao Paulo, Brazil
View GitHub Profile
curl 'http://127.0.0.1:9200/_recovery?pretty&human'
{
"bloonix-2016-01" : {
"shards" : [ {
"id" : 1,
"type" : "STORE",
"stage" : "DONE",
"primary" : true,
"start_time" : "2016-02-03T14:12:48.584Z",
"start_time_in_millis" : 1454508768584,
curl 'http://127.0.0.1:9200/_cluster/health?pretty=true'
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 5,
"active_shards" : 5,
"relocating_shards" : 0,
curl 'http://127.0.0.1:9200//bloonix-2016-01'
{
"bloonix-2016-01": {
"aliases": {},
"mappings": {
"event": {
"properties": {
"attempts": {
"type": "string"
},
POST /bloonix-2016-02/stats/?routing=10 HTTP/1.1
Accept-Encoding: compress, gzip
Connection: close
Host: 127.0.0.1:9200
User-Agent: HTTP-Tiny/0.039
Content-Length: 93
Content-Type: application/json; charset=UTF-8
{"data":{"time":110.697},"time":"1454509382000","host_id":"10","service_id":93,"plugin_id":7}HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=UTF-8
server {
# listen 80;
server_name foobar.com www.foobar.com www.foobar.com.br;
location = / {
return 302 http://foobar.com.br?;
}
location / {
return 302 http://foobar.com.br$request_uri;
use strict;
use HTTP::Async;
use HTTP::Request;
use IO::Socket::SSL qw(debug4);
use URI;
my $async = HTTP::Async->new( );
use strict;
my @tests = (qw/+5511951345146 +551138765980 +550CR1138765980 +550CR11951345146 +55CR1138765980/);
for my $telnum (@tests) {
my $info = &parsetelephone($telnum);
use DDP;
p [ $telnum, $info ];
@renatocron
renatocron / bench-templates-systems.pl
Last active June 26, 2017 15:30
Benchmarking Mojo::Template / Text::Xslate /Template with loops and condicionals
use strict;
use warnings;
use Mojo::Template;
use Text::Xslate;
use Template;
# some useful options (see below for full list)
my $config = {
EVAL_PERL => 0, # evaluate Perl code blocks
};
<?php /*457563643*/ error_re...
with orig as (
select 'original value'::text as foo limit 1
),
orig_if_not as (
select 'the value if first query returns no rows'::text as foo
)
select coalesce(a.foo, b.foo) as the_foo
from orig a
right join orig_if_not b on (a.foo is not null)