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
| /** | |
| * Script to parse a Postman backupt to Insomnia keeping the same structure. | |
| * | |
| * It parses: | |
| * - Folders | |
| * - Requests | |
| * - Environments | |
| * | |
| * Notes: Insomnia doesn't accept vars with dots, if you are using you must replace yours URLs manually (see ENVIRONMENTS_EXPORTS). | |
| */ |
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
| Segue a lista de comandos docker e sua utilidade: | |
| docker attach – Acessar dentro do container e trabalhar a partir dele. | |
| docker build – A partir de instruções de um arquivo Dockerfile eu possa criar uma imagem. | |
| docker commit – Cria uma imagem a partir de um container. | |
| docker cp – Copia arquivos ou diretórios do container para o host. | |
| docker create – Cria um novo container. | |
| docker diff – Exibe as alterações feitas no filesystem do container. | |
| docker events – Exibe os eventos do container em tempo real. | |
| docker exec – Executa uma instrução dentro do container que está rodando sem precisar atachar nele. |
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
| // Add our dependencies | |
| var gulp = require('gulp'), // Main Gulp module | |
| concat = require('gulp-concat'), // Gulp File concatenation plugin | |
| open = require('gulp-open'), // Gulp browser opening plugin | |
| connect = require('gulp-connect'); // Gulp Web server runner plugin | |
| // Configuration | |
| var configuration = { | |
| paths: { |
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
| # How to create an RPM from source with spec file | |
| # This is for Redhat versions of linux. Sometimes when you search for an rpm package, | |
| # it is either outdated or not available. The only thing available is the source code. | |
| # You can create a custom RPM package from source. | |
| # | |
| # For this example, I'll be using the latest version of Git, currently v.1.7.7.3 | |
| # Step: 1 | |
| # Install rpmbuild |
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 | |
| // A função abaixo demonstra o uso de uma expressão regular que identifica, de forma simples, telefones válidos no Brasil. | |
| // Nenhum DDD iniciado por 0 é aceito, e nenhum número de telefone pode iniciar com 0 ou 1. | |
| // Exemplos válidos: +55 (11) 98888-8888 / 9999-9999 / 21 98888-8888 / 5511988888888 | |
| function phoneValidate($phone) | |
| { | |
| $regex = '/^(?:(?:\+|00)?(55)\s?)?(?:\(?([1-9][0-9])\)?\s?)?(?:((?:9\d|[2-9])\d{3})\-?(\d{4}))$/'; | |
| if (preg_match($regex, $phone) == false) { |
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
| // ES6 w/ Promises | |
| // Note: From a React starter template - see https://t.co/wkStq8y3I5 | |
| function fetchData(routes, params) { | |
| let data = {}; | |
| return Promise.all(routes | |
| .filter(route => route.handler.fetchData) | |
| .map(route => { | |
| return route.handler.fetchData(params).then(resp => { | |
| data[route.name] = resp; |
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 messages = [ | |
| "message1", | |
| "message2" | |
| ]; | |
| var message_time_ms = 1000; | |
| var index = 0; | |
| document.title = messages[index]; | |
| window.setInterval(function(){ | |
| document.title = messages[index++ % messages.length]; |