Skip to content

Instantly share code, notes, and snippets.

@robsonsobral
robsonsobral / cpf_cnpj_validator
Created July 17, 2017 18:10 — forked from igorcosta/cpf_cnpj_validator
Regex para validar CPF e CNPJ
Para CPF
/^\d{3}\.\d{3}\.\d{3}\-\d{2}$/
Para CNPJ
/^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/
Para ambos ao mesmo tempo
@robsonsobral
robsonsobral / bubble-range.js
Created March 23, 2017 20:14 — forked from dmolsen/bubble-range.js
jQuery-less version of Chris Coyier's Value Bubbles for Range Inputs
/**********************************************************
* jQuery-less version of Chris Coyier's
* Value Bubbles for Range Inputs
* http://css-tricks.com/value-bubbles-for-range-inputs/
**********************************************************/
function modifyOffset() {
var el, newPoint, newPlace, offset, siblings, k;
width = this.offsetWidth;
newPoint = (this.value - this.getAttribute("min")) / (this.getAttribute("max") - this.getAttribute("min"));
#!/bin/bash
# Location of the nginx config file that contains the CloudFlare IP addresses.
CF_NGINX_CONFIG="/etc/nginx/cloudflare"
# The URLs with the actual IP addresses used by CloudFlare.
CF_URL_IP4="https://www.cloudflare.com/ips-v4"
CF_URL_IP6="https://www.cloudflare.com/ips-v6"
# Temporary files.
CF_TEMP_IP4="/tmp/cloudflare-ips-v4.txt"
CF_TEMP_IP6="/tmp/cloudflare-ips-v6.txt"
# Download the files.
@robsonsobral
robsonsobral / dabblet.css
Created February 26, 2014 01:40
transition using width or height auto
/**
* transition using width or height auto
*/
ul,li {
display: block;
margin: 0;
padding: 0;
width: 250px;
}
li {
@robsonsobral
robsonsobral / inline-block-example.html
Created July 29, 2011 04:29 — forked from necolas/inline-block-example.html
Inline-block layout component
<div class="ibw">
<div class="ib">inline block</div>
<div class="ib">inline block</div>
<div class="ib">inline block</div>
</div>