Skip to content

Instantly share code, notes, and snippets.

View Nick-Gabe's full-sized avatar
💻
Coding

Nícolas Gabriel Nick-Gabe

💻
Coding
View GitHub Profile
@Nick-Gabe
Nick-Gabe / Pombify.js
Last active January 6, 2024 01:57
Transforma uma string em pombês, e traduz para a língua dos humanos.
const pombify = (phrase) => {
return phrase
.split(' ')
.map((word) => {
const wordLetters = word.split('')
return wordLetters
.map((letter, index) => {
const charCode = letter.charCodeAt(0);
const binary = charCode
.toString(2)
@Nick-Gabe
Nick-Gabe / RabbitHole.js
Last active October 15, 2022 09:59
Code used to answer the Rabbit Hole challenge.
// tamanho do tabuleiro ao todo e quantas colunas tem em uma fileira
const boardSize = 500;
const holesPerRow = 50;
// tempo em ms de delay do intervalo do game loop
const loopDelay = 25;
// emojis, só pra deixar bonitinho kkkk
const emojis = {
blank: '🟫',
type Numeros = ['zero', 'um', 'dois', 'tres', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove'];
type Dezenas = ['','','vinte', 'trinta', 'quarenta', 'cinquenta', 'sessenta', 'setenta', 'oitenta', 'noventa'];
type Cem = ['cem'];
type Centenas = ['cento', 'duzentos', 'trezentos', 'quatrocentos', 'quinhentos', 'seiscentos', 'setecentos', 'oitocentos', 'novecentos'];
type GetWords<Str extends string, Curr extends string = ''> =
Str extends `${infer L}${infer R}`
? L extends ' '
? Curr
: GetWords<R, `${Curr}${L}`>
@Nick-Gabe
Nick-Gabe / setStyle.ts
Created June 23, 2022 23:52
Adds styles to a Html Element based on a CSS Object.
interface HTMLElement {
setStyle(newStyles: Partial<CSSStyleDeclaration>): void;
}
HTMLElement.prototype.setStyle = function (newStyles) {
for (let style in newStyles) {
this.style[style] = newStyles[style]!
}
}
@Grubba27
Grubba27 / fib_fat.ts
Created May 9, 2022 23:32
Fibonacci formula and Fatorial one made simple with TS types :D
type Reverse<A> =
`${A}` extends `${infer AH}${infer AT}`
? `${Reverse<AT>}${AH}` : A
type Digs = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
type DigsNext<I = Digs, R = {}> =
I extends [infer Head, infer Next, ...infer Tail]
? DigsNext<[Next, ...Tail], R & Record<Head, Next>>
@Nick-Gabe
Nick-Gabe / catbot.js
Created April 2, 2022 14:26
Código pra mandar gatos pelo zap
const { default: axios } = require('axios');
const qrcode = require('qrcode-terminal');
const { Client, MessageMedia } = require('whatsapp-web.js');
const client = new Client();
client.on('qr', (qr) => {
// Generate and scan this code with your phone
qrcode.generate(qr, {small: true});
});
@lucianodiisouza
lucianodiisouza / gist:bad9ee2e73bfd33fd6ca4a601fabf6c3
Created February 5, 2021 05:25
Tabela de transparências - HEXADECIMAIS
- **100% — FF**
- 99% — FC
- 98% — FA
- 97% — F7
- 96% — F5
- 95% — F2
- 94% — F0
- 93% — ED
- 92% — EB
- 91% — E8
@thiagodelgado111
thiagodelgado111 / intro.md
Created April 5, 2020 03:30 — forked from derhuerst/intro.md
Installing Git on Linux, Mac OS X and Windows
@deepakpk009
deepakpk009 / media.json
Created November 8, 2017 14:02
sample free video urls
{
"categories": [
{
"name": "Movies",
"videos": [
{
"description": "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources": [
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
],
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 5, 2024 04:49
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example