This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sum(a) { | |
return function (b) { | |
if(typeof(b) === 'number') | |
return sum(a + b) | |
return a | |
} | |
} | |
console.log(sum(5)()) // 5 | |
console.log(sum(5)(10)()) // 15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function diffDate(dateInit, dateEnd) { | |
const d1 = new Date(dateInit).getTime() | |
const d2 = new Date(dateEnd).getTime() | |
if (d1 === d2) { | |
return { | |
'TotalDays' : 0, | |
'Result' : 'The two dates are the same.' | |
} | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A0j0RQAhIghdIoJ0igiiWUC3iGoXEdQvAIqGUeIYRMuI9ExB0wi5JqJtCvhGSY0jonOUxDpK0kEALRTVQ0A1kQhdVGgjVX1UoJEi1UkVzSTKTRV2UvFT0VAqLYXgKWkq6CqhtgJQfSUCYwHIWQCsJYLgLUHcJUh7pb+AMliUDiMWK+kxpSaL5LKwmaLPgIymymmlVgNQeA3QbJVuU7Ab6beq4SIcB6C0HOo5pOmo60psJ/CdoMZD6DyF1ouU/aK4yMJqijBZCUYLq4GYCLyD2lFYNZ9ydaLC5KaqwjvFXh0RUlquek8fF1aDkvVG13KVpAXeHIXVoGS90bVcrgIFDUxuYZVcdl84cE5wYdV8yrrTog5yWK6uz/wGl9C4XaubwyALQdzC6uYwyEIQ13/KutOiDlJU3RwGWQji+k95Lnw3jaoznbFcFZC7hP33cWF1rS9pSQ5F1pJIkWgoElkGRDXlSVEVqL61KCm1YsXK0DJMDiClyIGa8uSwiusPWCwia8kB6YBlKBJJDqU15clhuUoWfoC2HQk+qWBzNK+aT1nZeKPqTGeskoUfIRJk46orAwjAiFA1bLoNJFFY3fZTtLBqkxs0RXBhFXGaJhpcRy61rqI2uVEHKWFpsmqcpokG15EjrVQTj27eT6v5hHAestGH5ap9CYqmk3sLq4jTNNHgOshyNbVNc9vLZWNhFbXJjTpICUuTVcRpmmhwHVE18ejm/bQKp4twDqbDcrl63ya8n8JA5CrAfAL4WC5XDS8IjBZWxysQ+8D8txcUOEF5Jfh4QeAqnK5s9CE4XoH4dAkOyiCcrmz0IZgcDoBykfWwikB26iAYMHBOMEBqe4+rcLqy0YfgeAXi0yU4KINwurLRh6AIlIuqx6bbQBL5wvwUILW9x1U4XYRzMB2C4tMlOCiDcLoI52A6BOVISREoH0hWxysQ+8D8txcUEgwUfLwgcBVOFxyvQHy6BAdlEE4XlFqxBuXJobSaL6aJHi8IXM0nhPOQjT4ExadLcFAG8wnh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let interval = null | |
let count = 10000 | |
let ntt = function(){ | |
interval = setInterval(function(){ | |
document.querySelectorAll('[data-testid=unlike]').forEach((t)=> { | |
t.click() | |
}) | |
count += 1000 | |
window.scrollTo(0, count); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ********************************************* | |
# * ~/.bashrc Personalizado para Ubuntu * | |
# * System: Ubuntu 12.04 – Precise Pangolin * | |
# * local: /home/user/.bashrc * | |
# * * | |
# * Author: Thiago Nalli Valentim * | |
# * E-Mail: [email protected] * | |
# * Date: 2012-05-24 * | |
# ********************************************* | |
# ====================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/mathiasbynens/dotfiles | |
git clone https://github.com/mathiasbynens/dotfiles.git && cd dotfiles && source bootstrap.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import binascii | |
import os | |
def to_binary(frase): | |
return bin(int(binascii.hexlify(frase), 16)) | |
def to_ascii(frase): | |
return binascii.unhexlify('%x' % int(frase, 2)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
alfabeto = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
def criptografar(normal, chave): | |
cifrado = '' | |
normal = normal.upper() | |
for letra in normal: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Retorno: [1] - Se for válido | [0] - Se for inválido | |
int validarCPF(char *cpf) | |
{ | |
int i, j, digito1 = 0, digito2 = 0; | |
if(strlen(cpf) != 11) | |
return 0; | |
else if((strcmp(cpf,"00000000000") == 0) || (strcmp(cpf,"11111111111") == 0) || (strcmp(cpf,"22222222222") == 0) || | |
(strcmp(cpf,"33333333333") == 0) || (strcmp(cpf,"44444444444") == 0) || (strcmp(cpf,"55555555555") == 0) || | |
(strcmp(cpf,"66666666666") == 0) || (strcmp(cpf,"77777777777") == 0) || (strcmp(cpf,"88888888888") == 0) || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE* open_file(char *name, char *extension){ | |
FILE* file; | |
file = fopen(name, extension); | |
if(file == NULL){ | |
printf("\nAn error occurred while trying to open the file.\n"); | |
} | |
return file; | |
} |