Skip to content

Instantly share code, notes, and snippets.

View IgorDePaula's full-sized avatar
😆

Igor C. de Paula IgorDePaula

😆
View GitHub Profile
@IgorDePaula
IgorDePaula / angular_fill_table.html
Created January 27, 2015 21:07
Preencho cada posicao celular com um conteudo diferente
<!DOCTYPE html>
<html ng-app="App">
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
table{
border:1px solid red;
border-collapse: collapse;

SSL upgrades on rubygems.org and RubyInstaller versions

UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released. It requires manual installation, please see instructions below.


Hello,

If you reached this page, means you've hit this SSL error when trying to

@IgorDePaula
IgorDePaula / colors.php
Created April 29, 2015 00:18
Class to generate colored strings on terminal.
<?php
class Colors {
private $foreground_colors = array();
private $background_colors = array();
public function __construct() {
// Set up shell colors
$this->foreground_colors['black'] = '0;30';
$this->foreground_colors['dark_gray'] = '1;30';
function(req, res){
//query
var query = req.params();//ou req.params('campo');
var post = req.body;//ou req.body.campo;
res.send('template');//ou res.json('sem comentarios')
}
# in case of conflict with local nginx:
# make sure in all *.confs (
# also in default and example to avoid error like
# 'nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)'
# )
# set for instance "listen 127.0.0.1:80" instead of "listen *:80"
# docker & network settings
DOCKER_IMAGE_NAME="maxexcloo/nginx-php" # build of nginx-php - for example
DOCKER_CONTAINERS_NAME="nginx_bridged" # our container's name
<?php
//codigo do teste
$I->click('#select2-chosen-2');
$I->fillField('#s2id_autogen2_search', 'Masculino');
$I->click('[value="M"]');
?>
/*
* This code requires both RabbitMQ and delayed message plugin is installed.
* The plugin can be found here https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/
*
* Refeence: https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/
*/
'use strict';
var amqp = require('amqplib'),
@IgorDePaula
IgorDePaula / multi-elastica.php
Created January 26, 2016 17:03
Busca de vários termos em vários campos do documento no elastic search. Usada a lib ruflin\elastica.
<?php
include 'vendor/autoload.php';
use Elastica\Client;
use Elastica\Document;
use Elastica\Query;
use Elastica\Query\MultiMatch;
use Elastica\Type\Mapping;
var users =[
{
"email": "teste01@teste.com.br",
"papeis": [
{
"id_papel_usuario": 2
},
{
"id_papel_usuario": 3
}
var cheerio = require('cheerio'),
http = require('http'),
max_articles=2,
host = 'http://painel.blogfolha.uol.com.br';
var options = {
host: host,
path: '/',
method: 'GET',