Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hcode Menu</title>
<style>
body {
margin: 0;
width: 100%;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hcode CSS 3</title>
<style>
.linear {
display: flex;
background-color: #000000;
@joaohcrangel
joaohcrangel / horizontal-scroll.css
Last active March 9, 2020 17:57
Horizontal Scroll
.wrap {
display: flex;
justify-content: flex-start;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
-moz-overflow-scrolling: touch;
margin: 0;
padding: 0;
@joaohcrangel
joaohcrangel / select_estados.html
Created February 10, 2020 02:04 — forked from quagliato/select_estados.html
<select> com todos os estados brasileiros
<select id="estado" name="estado">
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
<option value="ES">Espírito Santo</option>
<option value="GO">Goiás</option>
@joaohcrangel
joaohcrangel / NavigatorInfo.php
Last active October 16, 2019 15:04
Mostrar as informações do navegador do usuário usando o PHP.
function navigatorInfo() {
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version= "";
// First get the platform?
if (preg_match('/Android/i', $u_agent)) {
$platform = 'android';
} elseif (preg_match('/iPhone|Darwin/i', $u_agent)) {
if(!function_exists('debug')){
function debug(){
echo "<pre>";
foreach(func_get_args() as $arg){
print_r($arg);
}
echo "</pre>";
}
}
@joaohcrangel
joaohcrangel / README.md
Created July 15, 2019 05:18 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
let encode64 = function (input) {
input = escape(input);
var output = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = "";
var i = 0;
do {
function isValidCPF($number)
{
$number = preg_replace('/[^0-9]/', '', (string) $number);
if (strlen($number) != 11)
return false;
for ($i = 0, $j = 10, $sum = 0; $i < 9; $i++, $j--)
$sum += $number{$i} * $j;
@joaohcrangel
joaohcrangel / validation-cpf.ts
Last active February 10, 2025 17:59
Função para validar CPF em TypeScript
function isValidCPF(value: string) {
if (typeof value !== 'string') {
return false;
}
value = value.replace(/[^\d]+/g, '');
if (value.length !== 11 || !!value.match(/(\d)\1{10}/)) {
return false;
}