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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !^/blog.* | |
RewriteCond %{REQUEST_URI} !-f | |
RewriteRule ^$ app/webroot/ [L] | |
RewriteCond %{REQUEST_URI} !^/blog.* | |
RewriteCond %{REQUEST_URI} !-d | |
RewriteRule (.*) app/webroot/$1 [L] |
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 valor_extenso($valor=0, $maiusculas=false) | |
{ | |
// verifica se tem virgula decimal | |
if (strpos($valor,",") > 0) | |
{ | |
// retira o ponto de milhar, se tiver | |
$valor = str_replace(".","",$valor); | |
// troca a virgula decimal por ponto decimal |
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
function removeAcentos($Msg) { | |
$a = array ( | |
"/[ÂÀÁÄÃ]/" => "A", | |
"/[âãàáä]/" => "a", | |
"/[ÊÈÉË]/" => "E", | |
"/[êèéë]/" => "e", | |
"/[ÎÍÌÏ]/" => "I", | |
"/[îíìï]/" => "i", | |
"/[ÔÕÒÓÖ]/" => "O", | |
"/[ôõòóö]/" => "o", |
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 | |
namespace app\Models; | |
use Illuminate\Database\Eloquent\Model; | |
/** | |
* Class Segment. | |
*/ | |
class Segment extends Model |
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
// Metodo no meu controller | |
public function store(Request $request) | |
{ | |
try { | |
DB::beginTransaction(); | |
$data = $request->input(); | |
$validator = Validator::make($data, [ | |
'razao_social' => 'required', | |
'nome_fantasia' => 'required', | |
'telefone_1' => 'required', |
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 | |
namespace app\Models; | |
use Exception; | |
use Illuminate\Database\Eloquent\Model; | |
/** | |
* Class Segment. | |
*/ |
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 store(Request $request) | |
{ | |
try { | |
DB::beginTransaction(); | |
$data = $request->input(); | |
$validator = Validator::make($data, [ | |
'razao_social' => 'required', | |
'nome_fantasia' => 'required', | |
'telefone_1' => 'required', | |
'cnpj' => 'required', |
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 | |
echo "Installing meld..." | |
apt-get install meld -y -qq | |
echo "Meld [OK]" | |
echo "Creating meld custom script..." | |
rm ~/.config/git_meld_diff.sh | |
touch ~/.config/git_meld_diff.sh | |
echo "#!/bin/bash" >> ~/.config/git_meld_diff.sh |
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
$login = 'hjk3kj3h534h53kj4j345'; | |
$password = '3k45jh3k4j5h3k4j5h34kh5k34'; | |
$url = 'https://apic1.hml.stelo.com.br/'; | |
$encode = base64_encode("$login:$password"); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,$url); | |
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); |
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
try { | |
$clientId ='cf8db6fe61bc1efebc6ae4f5ab4af60c'; | |
$clientSecret = 'f538b73a11eac49827f6da678e859fa7'; | |
$auth_token = base64_encode($clientId . ':' . $clientSecret); | |
$target_url = 'https://apic1.hml.stelo.com.br'; | |
$ch = curl_init($target_url); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_USERPWD, $clientId . ':' . $clientSecret); | |
$headers = array('Authorization=Basic ' . $auth_token); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); |