Skip to content

Instantly share code, notes, and snippets.

View barbaromatrix's full-sized avatar
💭
Faça esportes.

Matheus barbaromatrix

💭
Faça esportes.
View GitHub Profile
@solenoid
solenoid / gist:1372386
Created November 17, 2011 04:49
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};
@erikhenrique
erikhenrique / bin-cc.md
Last active June 30, 2024 22:14
Bin de cartões de crédito para validação

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3
@rafakato
rafakato / language.js
Created September 9, 2016 18:12
Joi pt-BR language
'use strict';
const internals = {};
exports.errors = {
root: 'value',
key: '"{{!key}}" ',
messages: {
wrapArrays: true
},
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@onildoaguiar
onildoaguiar / delete-local-branches-that-do-not-exist-remotely.md
Last active December 27, 2022 17:22
Delete local branches that do not exist remotely

About

Delete local branches that do not exist remotely.

$ git fetch --all --prune; git branch --verbose | grep ": gone]" | awk '{ print $1 }' | xargs --no-tags 1 git branch --delete --force
@isabelandss
isabelandss / styles.js
Last active December 25, 2018 13:12
Styled Component with Carbon Design System Reference
//https://www.carbondesignsystem.com/components/button/code
import styled from 'styled-components'
const COLORS = {
primary: '#fff',
secondary: '#3d70b2',
tertiary: '#5a6872',
ghost: '#3d70b2',
danger: '#e0182d',