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
#!/bin/bash | |
# Include this file on crontab | |
# | |
PASS="#123{msaoi0921%" | |
# Create Dir for backups | |
mkdir -p /bkp/tmp >/dev/null 2>&1 | |
mkdir -p /bkp/www >/dev/null 2>&1 | |
mkdir -p /bkp/db >/dev/null 2>&1 | |
mkdir -p /bkp/conf >/dev/null 2>&1 | |
data=`date +%d-%m-%Y-%H-%M` |
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
$tel = $_REQUEST[tel]; | |
function trataNumero($tel) { | |
echo strlen($tel).'<br>'; | |
// seria melhor cirar uma white list. | |
// tratando manualmente | |
$tel = str_replace("-", "", $tel); | |
$tel = str_replace("(", "", $tel); | |
$tel = str_replace(")", "", $tel); | |
$tel = str_replace("_", "", $tel); |
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 | |
Class pagSeguro { | |
public function pay(){ | |
$url = 'https://ws.sandbox.pagseguro.uol.com.br/v2/pre-approvals/request'; | |
$data['email'] = 'SEUEMAIL'; | |
$data['token'] = 'SEUTOKEN'; | |
$data['currency'] = 'BRL'; |
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
/* | |
* @Author: David Silva | |
* @Description: This class makes the connection with facebook and get the posts of the specified group | |
* @Required: Facebook PHP SDK, Class Model for pass parameters | |
* | |
*\ | |
class FBOverFlow { | |
function pegaPosts($grupoId) { |
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
free -m | |
mkdir -p /var/_swap_ | |
cd /var/_swap_ | |
#Here, 1M * 2000 ~= 2GB of swap memory | |
dd if=/dev/zero of=swapfile bs=1M count=2000 | |
mkswap swapfile | |
swapon swapfile | |
chmod 600 swapfile | |
echo "/var/_swap_/swapfile none swap sw 0 0" >> /etc/fstab | |
#cat /proc/meminfo |
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
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<?php | |
/* | |
* Este helper entra em todos os arquivos txt do diretorio corrente, abre eles e pega todas as linhas. | |
* Montando uma estrutura de inserção para uma seeder no Laravel. | |
* Para ele funcionar bastar inserí-lo dentro do diretorio que contem os .txt e executá-lo no browser. | |
* A saída da execução (no browser) pode ser copiada direto para o arquivo seeder. | |
* Nota: O título do arquivo cria uma entrada no banco também, considerando que o seu conteúdo será seus filhos no banco. | |
* Ex: Administradores.txt -> Criará um comando DB:: com o dado Administradores e criará comandos para cada linha que conter dentro do arquivo, considerando o ID da criação do Pai. |
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
Show hidden characters
{ | |
// Laravel Snippets | |
"dd": { | |
"prefix": "dd", | |
"body": "\ndump(${1:Title!});\ndie();\n", | |
"description": "Simple DD for Laravel 4.2", | |
"scope": "php" | |
}, | |
// PHP Snippets | |
"public function - PHP": { |
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
public function search($input = []) { | |
$query = $this->model; | |
if (isset($input['tenant_id'])) | |
$query = $query->ofTenantId($input['tenant_id']); | |
if (isset($input['keywords']) && ($k = $input['keywords'])) { | |
$query = $query | |
->where(function ($subquery) use ($k) { | |
return $subquery | |
->where('last_name', 'like', "%{$k}%") |
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
Anexo Único | |
(Redação dada pela Instrução Normativa RFB nº 1.268, de 10 de maio de 2012) | |
1. Capítulo 12 SEMENTES E FRUTOS OLEAGINOSOS; GRÃOS, SEMENTES E FRUTOS DIVERSOS; PLANTAS INDUSTRIAIS OU MEDICINAIS; PALHAS E FORRAGENS | |
1.1. Posição 1201 Soja, mesmo triturada. | |
Atributos e Especificações de Nível 'P' | |
1.1.1. Atributo AA COLORAÇÃO | |
Especificações: | |
0001 Amarela |
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 | |
/** | |
* Array com dicionario de Dados para tratativa em gerador automático de DI Siscomex | |
* Lista completa em texto: http://urlshortener.at/lt179 | |
* | |
*/ | |
return | |
[ | |
[ |
OlderNewer