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 | |
| $url = 'https://assets.b9.com.br/wp-content/uploads/2014/05/google-novo-logo.jpg'; | |
| $auth = base64_encode('USUARIO:SENHA'); | |
| $aContext = array( | |
| 'http' => array( | |
| 'proxy' => 'tcp://192.168.0.0:1234', | |
| 'request_fulluri' => true, |
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 | |
| /* | |
| Fomato de dados do push | |
| --------- | |
| $dados = array( | |
| 'data' => array( | |
| 'title' =>'Oi', | |
| 'message' => 'Hello World' | |
| ), |
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 gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var bower = require('bower'); | |
| var concat = require('gulp-concat'); | |
| var sass = require('gulp-sass'); | |
| var minifyCss = require('gulp-minify-css'); | |
| var rename = require('gulp-rename'); | |
| var sh = require('shelljs'); | |
| var 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
| export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
| export CLICOLOR=1 | |
| export LSCOLORS=ExFxBxDxCxegedabagacad | |
| alias ls='ls -GFh' |
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
| // Valida demais campos com parâmetro required | |
| $("[required]").each(function(index, element) { | |
| if($(element).val() == '') { | |
| alert('Preencha o campo "' + $(element).attr('name') + '"'); | |
| $(element).select().focus(); | |
| return false; | |
| } | |
| if($(element).attr('pattern')) { | |
| var r = new RegExp($(element).attr('pattern')); |
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 | |
| function csv($data, $caminho = '') { | |
| if(!$data || !is_array($data)) { | |
| return false; | |
| } | |
| if(!$caminho) { | |
| $caminho = 'arquivo.csv'; | |
| } | |
| $file = fopen($caminho, "w"); | |
| foreach ($data as $linha) { |
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 | |
| function sorteio() { | |
| $sorteio = array(); | |
| $contador = 0; | |
| while($contador < 6) { | |
| $numero = rand(1,60); | |
| if(!in_array($numero, $sorteio)) { | |
| $sorteio[] = $numero; | |
| $contador++; |
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
| $('a[target="_blank"]').click(function(){ | |
| ga('send', 'event', 'link-externo', 'click', $(this).attr('href')); | |
| }); |
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
| /* | |
| EXERCÍCIO | |
| Fazer um programa para o tribunal eleitoral que apresente um menu com as seguintes opções: | |
| [1] – Mané Furtado | |
| [2] – Vô Roubar | |
| [3] – Só Ladrão | |
| [4] – Zé Pilantra | |
| [5] - Encerrar | |
| Digite o seu voto: _ | |
| OBS: |