Skip to content

Instantly share code, notes, and snippets.

View danielnass's full-sized avatar
🚀
Ship it!

Daniel Nass danielnass

🚀
Ship it!
View GitHub Profile
@danielnass
danielnass / PATCH.md
Last active June 17, 2024 18:35
Flora & Stiches GAMBIARRA

O pacote Stitches que o Flora utiliza possui diversas correções e melhorias não lançadas, apenas buildadas, inclusive compatbilidade com a versão do TypeScript mais recente. As issues relacionadas ao problema do TS aqui e aqui.

Nesse passo a passo ensino como você pode aproveitar essas melhorias e também corrigir o problema do TypeScript The type of this node cannot be serialized because its property '[$$PropertyValue]' cannot be serialized, que acontece quando queremos usar o TypeScript 4.8+ e exportar um componente de um arquivo, como pode ser visto na imagem a seguir.

Captura de Tela 2023-07-18 às 17 13 14

Algumas threads já foram levantadas no Slack sobre a incopatibilidade

@danielnass
danielnass / bug_fix.md
Last active June 15, 2023 16:02
Pull Request Templates

🐞 The problem

What is happening 🔥 What is causing it 🔥

👣 Steps to reproduce

How to reproduce the bug step by step

🧑‍💻 The fix

@danielnass
danielnass / javascriptArrayReduceFromScratch.js
Created October 11, 2022 02:10
JavaScript Array Reduce from Scratch
// 1 - Create reduce function
function reduce(arr, fn, acc){
// 5 - Iterate over each array value and reduce it with the accumulator into only one, assigning the result to the accumulator
for(value of arr){
acc = fn(value, acc);
}
// 6 - Return the accumulator after iterates over each value of the array
return acc;
@danielnass
danielnass / javascriptArrayMapFromScratch.js
Created October 11, 2022 01:43
JavaScript Array Map From Scratch
// 1 - Create map function
function map(array, fn){
let newArr = [];
for (value of array){
newArr.push(fn(value));
}
return newArr;
}
@danielnass
danielnass / javascriptAsyncAwaitFromScratch.js
Last active October 11, 2022 01:43
JavaScript Async Await from scratch
function doWhenDataReceived(value){
// 4 - Call .next() passing the value from the Promise
fetchFlow.next(value);
}
function* createFlow(){
// 5 - Assign the Promise fullfiled value to data const
const data = yield fetch('https://twitter.com/api/paca/tweets');
// 6 - Console log the data value from the Promise
console.log(data);
@danielnass
danielnass / moveZeroesToEend.js
Created August 3, 2022 18:43
JavaScript - Move zeroes to end of the array
const arr = [0,1,0,2,0,3,0,4,0,5];
const arrZeroesFiltered = arr.filter((cv) => cv !== 0);
/*
* or if you know your arr will return just numbers
* and not things like null or undefined
* const arrZeroesFiltered = arr.filter(Boolean);
*/
const zeroes = arr.length - arrZeroesFiltered.length;
@danielnass
danielnass / search-react-component-by-name-regex.js
Created May 2, 2022 23:18
Regex for searching a React component by their name. Search just for the specific name, excluding extensions.
/* Search only for the specific name, excluding name extensions
** This example below will found
**
** <Anchor>Anchor Text</Anchor>
**
** <Anchor booleanProp>Anchor Text</Anchor>
**
** <Anchor prop="text">Anchor Text</Anchor>
**
** <Anchor prop={localProp}>Anchor Text</Anchor>
@danielnass
danielnass / apps.sh
Created August 1, 2020 18:56
101 apps
Image Shrinker
Itau
Snap Camera
Translator
Irvue
Amphetamine
Gifski
@danielnass
danielnass / brew-cask.sh
Last active August 1, 2020 18:56
Brew Cask list
aerial iterm2
epic-games java
figma jetbrains-toolbox
firecamp microsoft-edge
firefox phantomjs
firefox-developer-edition spotmenu
firefox-nightly steam
font-fira-code stremio
font-jetbrains-mono tidal
google-chrome transmission
@danielnass
danielnass / brew.sh
Created August 1, 2020 18:49
Brew list
antibody gdbm libtool pcre2 sqlite
asdf gettext libyaml phraseapp tree
autoconf git mas pkg-config unixodbc
automake htop nano postgresql@10 watchman
bash icu4c ncdu [email protected] wxmac
coreutils jpeg ncurses readline xz
ctop lazydocker openfortivpn redis zsh
diff-so-fancy libpng [email protected] ruby-build
exa libtiff pcre snappy