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 duplicateProtectedSheet() { | |
// Novas abas | |
const sheets = [ | |
"NOVA-ABA-1", | |
"NOVA-ABA-2", | |
"NOVA-ABA-3", | |
"NOVA-ABA-4", | |
] |
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 factorial(v: number): number { | |
return v === 0 ? 1 : v * factorial(v-1) | |
} | |
function binomial (m: number, n: number) { | |
if (n > m) return undefined | |
return factorial(m)/(factorial(n) * factorial(m - n)) | |
} |
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
const names = [ | |
'Name', | |
'Short Name', | |
'Name Getting Bigger', | |
'Name Considerable Big By Now', | |
'Name Absolutely Scary and Never Seen Before', | |
'This Should Not Be Considered a Name Anymore From This Point', | |
] | |
function join(name: Array<string>): string { |
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
# Both below work fine. | |
ffmpeg -i input.mp3 -vbr 4 -vn output.m4a | |
ffmpeg -i input.wav -vbr 4 -vn output.m4a |
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
/** | |
* Receives a date in the following format | |
*/ | |
function isValidDate(date: string) { | |
return /^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[13-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$/g.test(date) | |
} |
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
/** | |
* Respect immutability folks. | |
*/ | |
const toBeSortedNewArray = [...originalArray] | |
toBeSortedNewArray.sort(() => return 0.5 - Math.random()); |
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
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: t => t, | |
// accelerating from zero velocity | |
easeInQuad: t => t*t, | |
// decelerating to zero velocity |
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
/** | |
* In this example shows an implementation of handling the change of audio volume | |
* based on sequentials timeout functions. | |
* | |
*/ | |
let volume = 0 | |
function setVolume(volume: number) { console.log(volume) } |
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
const patternVector = [0.5276690030033288, 1.0149928060892972, 1.9035450216269536, 2.192746911523759, 0.44680492166066216] |
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
.wrapper { | |
display: flex; | |
flex-wrap: nowrap; | |
overflow-x: auto; | |
} | |
.wrapped { | |
flex: 0 0 auto; | |
} |