Skip to content

Instantly share code, notes, and snippets.

View fdaciuk's full-sized avatar
🔥

Fernando Daciuk fdaciuk

🔥
View GitHub Profile
@khalidx
khalidx / node-typescript-esm.md
Last active April 22, 2024 15:40
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@vmarcosp
vmarcosp / bsconfig.json
Created September 21, 2021 23:46
Configuração do compilador do ReScript - Curso EcmaScript2077
{
"name": "rescript-vanilla",
"sources": [
{
"dir": "src",
"subdirs": true
}
],
"package-specs": [
{
@sibelius
sibelius / learning-path-web3.md
Last active January 8, 2024 19:16
Learning Path Web3
  • learn blockchain concepts
  • learn ethereum
  • learn how to use metamask
  • learn how to use hardhat (https://hardhat.org/)
  • learn how to deploy and interact with a smart contract
  • learn common smart contract standards like ERC20 (token), ERC721 (nft), ERC1155 (opensea)
  • learn ipfs
  • learn how to read blockchain explorers like https://etherscan.io/
  • learn how to use web3 and etherjs
  • learn solidity
@vmarcosp
vmarcosp / links-live-rescriptbr.md
Last active November 25, 2022 16:22
Links de todas as referências, redes sociais e sites utilizados nas lives de ReScript
@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
}
@pedronauck
pedronauck / useHotkeys.ts
Created December 11, 2018 02:03
usePopper and useHotkeys hooks
import { useEffect } from 'react'
import hotkeys from 'hotkeys-js'
export const useHotkeys = (key: string, cb: () => any, inputs?: any[]) => {
useEffect(() => {
hotkeys(key, cb)
return () => hotkeys.unbind(key)
}, inputs)
}
@RatoX
RatoX / ports.sh
Last active September 25, 2018 00:20
List all ports used by your user with the process name
#!/bin/bash
# This is in progress I tested it only on macOS 10.13.6
# outuput e.g:
# PID (319) Spotify -> :57621
function ports {
PORTS=$(lsof -iTCP -sTCP:LISTEN -nP)
echo "$PORTS" | awk 'match($9, /[\]|\*]+:(.*)$/) { print " PID ("$2") "$1" -> "substr($9, RSTART+1, RLENGTH-1) }'
}
@cliffrowley
cliffrowley / STREAMDECK_HID.md
Last active February 20, 2024 06:24
Notes on the Stream Deck HID protocol

Stream Deck Protocol

How to interface with a Stream Deck device.

Synopsis

The device uses the HID protocol to communicate with its software.

Configuration

@fdaciuk
fdaciuk / Create Reducer.md
Created September 17, 2017 00:38
Less boilerplate when create a new reducer on Redux

Create Reducer

Less boilerplate when create a new reducer on Redux

Method:

'use strict'

const createReducer = (initialState, actionHandlers) => {