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
| var moment = require('moment'); | |
| var inicio = moment().set({hours:'08',minutes:'00'}); | |
| var fim = moment().set({hours:'18',minutes:'00'}); | |
| for(var interval = inicio; interval < fim; interval.add({hours:1,minutes:30})){ | |
| console.log(interval.format('HH:mm')); | |
| } |
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
| /* | |
| * 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'), |
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
| <?php | |
| $datas = new DatePeriod(new DateTime('2015-01-30'), new DateInterval('P1M'), 10); | |
| foreach ($datas as $data) { | |
| echo $data->format('d/m/Y'), '<br>'; | |
| } |
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
| <?php | |
| include 'vendor/autoload.php'; | |
| use Elastica\Client; | |
| use Elastica\Document; | |
| use Elastica\Query; | |
| use Elastica\Query\MultiMatch; | |
| use Elastica\Type\Mapping; |
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
| var users =[ | |
| { | |
| "email": "teste01@teste.com.br", | |
| "papeis": [ | |
| { | |
| "id_papel_usuario": 2 | |
| }, | |
| { | |
| "id_papel_usuario": 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
| var cheerio = require('cheerio'), | |
| http = require('http'), | |
| max_articles=2, | |
| host = 'http://painel.blogfolha.uol.com.br'; | |
| var options = { | |
| host: host, | |
| path: '/', | |
| method: 'GET', |
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
| var AWS = require('aws-sdk'); | |
| var spawn = require('child_process').spawn; | |
| var path = require('path'); | |
| var fs = require('fs'); | |
| var crypto = require('crypto'); | |
| AWS.config.loadFromPath('./config.json'); | |
| var Consumer = require('sqs-consumer'); | |
| var S3 = new AWS.S3(); | |
| var app = Consumer.create({ |
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
| <?php | |
| /** | |
| * Created by PhpStorm. | |
| * User: igor | |
| * Date: 25/06/16 | |
| * Time: 12:15 | |
| */ | |
| namespace Admin; |
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
| echo '[Unit] | |
| Description=High-performance, schema-free document-oriented database | |
| After=syslog.target network.target | |
| [Service] | |
| User=mongodb | |
| Group=mongodb | |
| ExecStart=/usr/bin/mongod -f /etc/mongod.conf | |
| [Install] |