This file contains 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
/** | |
* Encodes multi-byte Unicode string into utf-8 multiple single-byte characters | |
* (BMP / basic multilingual plane only). | |
* | |
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars. | |
* | |
* Can be achieved in JavaScript by unescape(encodeURIComponent(str)), | |
* but this approach may be useful in other languages. | |
* | |
* @param {string} unicodeString - Unicode string to be encoded as UTF-8. |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title></title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title></title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> |
This file contains 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
curl_setopt_array($curl, array( | |
CURLOPT_URL => "https://apic1.hml.stelo.com.br/", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "utf-8", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 30, | |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
CURLOPT_CUSTOMREQUEST => "POST", | |
CURLOPT_HTTPHEADER => array( | |
"authorization: Basic Y2Y4ZGI2ZmU2MWJjMWVmZWJjNmFlNGY1YWI0YWY2MGM6ZjUzOGI3M2ExMWVhYzQ5ODI3ZjZkYTY3OGU4NTlmYTc=", |
This file contains 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); |
This file contains 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 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 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 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 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', |
NewerOlder