Skip to content

Instantly share code, notes, and snippets.

@aaoliveira
aaoliveira / auth3.php
Created September 14, 2016 00:31
Terceiro exemplo de auth
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=",
@aaoliveira
aaoliveira / index.html
Created September 14, 2016 20:24
Checkout
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
@aaoliveira
aaoliveira / index.html
Created September 15, 2016 12:54
Novo exemplo
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
@aaoliveira
aaoliveira / utf8-regex.js
Created September 30, 2016 00:39 — forked from chrisveness/utf8-regex.js
Utf8 string encode/decode using regular expressions
/**
* 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.