Skip to content

Instantly share code, notes, and snippets.

View guilycst's full-sized avatar

Guilherme de Castro guilycst

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

function uuidv4() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, (function (c) {
return c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4})().toString(16)
)
}
let modelo = { nome: 'Guilherme', sobrenome: 'De Castro'};
let colecao = [
{ nome: 'João', sobrenome: 'Da silva'},
{ nome: 'João', sobrenome: 'Da silva', p1: '1'},
{ p1: 'p1', p2: 'p2'},
{ nome: 'João', hello: 'World'}
];
function padronizarCom(padrao, colecao){
const pnames = Object.getOwnPropertyNames(padrao);
let coordenadas = [
{ "nome": "São Paulo", "coordenadas": ["-23.6821604", "-46.8754915"] },
{ "nome": "Rio de Janeiro", "coordenadas": ["-22.9137531", "-43.5860657"] },
{ "nome": "Recife", "coordenadas": ["-8.0462741", "-35.0000824"] }
]
function prepararCoordenadas(coords) {
return coords.map(c => ({ "coordenadas": c.coordenadas.reverse().map(rc => +Number(rc).toFixed(4)), "nome": c.nome }));
}
const bsp = /\s{2,}/g;
function normalizar(string){
return capitalize(string.toLowerCase()).replace(bsp,' ').replace('xpto','NOALVO');
}
function capitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
@guilycst
guilycst / dabblet.css
Last active August 14, 2016 03:49 — forked from anonymous/dabblet.css
Untitled
background-color: black;
background-image: linear-gradient(to bottom, black, #C00 50%, black);
babackground-size: 5px 80%;
background-repeat: no-repeat;
background-size: 80% 5px;
background-position: 50% 50%;
@guilycst
guilycst / dabblet.css
Last active August 13, 2016 23:15 — forked from anonymous/dabblet.css
Untitled
.face {
display: block;
width: 200px;
height: 200px;
position: absolute;
top: 0;
left: 0;
}
.frente {
background-color: red;
@guilycst
guilycst / dabblet.css
Last active August 13, 2016 23:10
Cube
/**
* Cube
*/
body{
perspective:1px;
}
.cubo{
position:absolute;
top:200px;
left:200px;