Skip to content

Instantly share code, notes, and snippets.

@cristianobecker
cristianobecker / time-error.js
Created October 16, 2014 18:36
BRST problem in Javascript Date object
function nextDay() {
var date = new Date(2014, month, now + 1);
now = date.getDate();
return date;
}
var month = 9,
now = 0,
max = 50,
curr;
@cristianobecker
cristianobecker / vogal.js
Created September 23, 2014 19:59
Obter somente vogais
var utils = {};
utils.vogal = function (str) {
var h = Object.prototype.hasOwnProperty,
v = (str + '').replace(/[^aeiou]/g, ''),
d = {},
n;
for (var i in v) {
n = v[i];
if (h.call(d, n)) {
@cristianobecker
cristianobecker / cpf.js
Last active April 26, 2016 17:17
Validar CPF por javascript
var CPF = (function () {
var eleven = 11;
function mod(n) {
var t = eleven,
a = n % t;
return (a < 2 ? 0 : t - n % t) + '';
}
@cristianobecker
cristianobecker / foca.js
Created September 11, 2014 19:53
Foca no código
/* Foca no código
.---.
/o o\
__(= " =)__
//\'-=-'/\\
) (_
/ `"=-._
/ \ ``"=.