Skip to content

Instantly share code, notes, and snippets.

View fdaciuk's full-sized avatar
🔥

Fernando Daciuk fdaciuk

🔥
View GitHub Profile
@fdaciuk
fdaciuk / How to use async await without try-catch block.md
Last active April 22, 2024 14:31
How to use async/await without try/catch block

How to use async/await without try/catch block

We can use something like this:

async function resolveToNumber () {
  const promise = Promise.resolve(1)
  const [error, result] = await to(promise)
  console.log(error, result) // [null, 1] -> Here we have the result, and error will be null
}

Github Two-Factor Authentication (2FA) for Brazil via SMS

The Github doesn't provide country code for Brazil (+55). To add this option, just run the code below in your console. The option Brazil +55 will be the first on the list, already selected:


🇧🇷 [pt-BR]

Autenticação em dois fatores (2FA) do GitHub para o Brasil via SMS

@fdaciuk
fdaciuk / Adicionar novo campo (custom field) a uma taxonomia (categoria, tag, etc) no WordPress.md
Last active March 8, 2024 20:52
Adicionar novo campo (custom field) a uma taxonomia no WordPress (Incluir esse código no functions.php)Nas action_hooks, no lugar de "category" é só incluir o slug da sua taxonomia :)

Adicionar novo campo (custom field) a uma taxonomia (categoria, tag, etc) no WordPress

Incluir esse código no functions.php.

Nas action_hooks, no lugar de "category" é só incluir o slug da sua taxonomia :)

@fdaciuk
fdaciuk / 00 - Tailwind Colors + Styled Components + TypeScript.md
Last active February 14, 2024 16:28
Tailwind Colors + Styled Components + TypeScript

Configuration to use TailwindCSS colors in a Styled Components theme with CRA + TypeScript.

Tailwind colors list: https://tailwindcss.com/docs/customizing-colors#generating-colors

Create files src/@types/styled.d.ts and src/resources/theme.ts with content below. Then add the theme on your project:

import { ThemeProvider } from 'styled-components'
import { theme } from 'resources/theme'
@fdaciuk
fdaciuk / gnome-terminal-profiles.md
Last active December 4, 2023 19:20
Export / Import Gnome Terminal Profiles

Export Gnome Terminal Profile

List profiles

dconf dump /org/gnome/terminal/legacy/profiles:/

Determine the terminal profile string for the profile you will need. This is the terminal profile that I will export:

@fdaciuk
fdaciuk / Live Node.js + TS com Programação Funcional.md
Last active November 23, 2023 14:29
Live Node.js + TS com Programação Funcional
@fdaciuk
fdaciuk / Criar LiveUSB do Windows pelo Linux.md
Created August 21, 2023 12:58
Criar LiveUSB do Windows pelo Linux

Criar LiveUSB do Windows pelo Linux

Se você precisa criar uma imagem bootável com uma ISO do Windows pelo Linux, e tentou usando o comando dd, percebeu que não funciona (windows né?)

Abaixo as instruções de como criar corretamente uma imagem bootável do Windows usando Linux:

Passos:

  • Instale o WOEUSB
  • Após plugar o pendrive no PC, execute sudo fdisk -l para saber qual é o caminho do device (normalmente /dev/sdc, mas pode mudar)