Skip to content

Instantly share code, notes, and snippets.

View tgmarinho's full-sized avatar
💻
read my blog: tgmarinho.com

Thiago Marinho tgmarinho

💻
read my blog: tgmarinho.com
View GitHub Profile
@sibelius
sibelius / asyncMentoring.md
Last active November 23, 2022 22:16
async mentoring rules

Async Mentorship

Most mentees belive that they need sync mentorship to be able to explain their problems. However, I've found that doing an async mentorship using text to provide better results. Mentorship is a long term process, you can't "fix" or "improve" someone in a session, it takes time.

image

Mentorship Cycle

The mentee will pass in the 3 steps of the mentorship cycle. The first one is to be in a given situation, or having some problem or doubt.

@fersilva16
fersilva16 / recursive-chunk.ts
Last active December 14, 2021 23:15
Chunk array by n length
function chunk(n: number, xs: number[]) {
if (!xs.length) return [];
return [xs.slice(0, n), ...chunk(n, xs.slice(n))];
}
@EmanuelCampos
EmanuelCampos / mailProvider.ts
Created September 29, 2021 10:30
Mail Provider
import nodemailer, { Transporter } from 'nodemailer'
import fs from 'fs';
import handlebars from 'handlebars';
import { SES } from 'aws-sdk'
import { SESClient, SendEmailCommand } from '@aws-sdk/client-ses';
import { IMailParams, IMailProvider } from '../protocols/IMailProvider';
import { config } from '@config/config';
@nandorojo
nandorojo / private-npm-in-gh-actions.md
Created August 3, 2021 23:52
Use private NPM packages in your GitHub actions

1 NPM_TOKEN

Add an NPM_TOKEN secret on GitHub. Get your secret key from the NPM dashboard.

2 Add a step to your action

- name: Authenticate with private NPM package
  run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
@dabit3
dabit3 / NFT.sol
Last active March 6, 2022 22:44
Basic NFT Smart Contract
// contracts/NFT.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
@sibelius
sibelius / LookingForTheFirstJob.md
Last active July 3, 2023 08:48
Looking for the First Job state

Looking for the First Job

Versão em Português

This is a very common state for people in college, people before/after a bootcamp, or people from another area.

The first job will be the hardest one to get, but it will get easier over time.

The interview will be harder than the job itself

@sibelius
sibelius / RedisCache.ts
Last active July 31, 2021 16:20
Basic RedisCache implementation
import Redis, { KeyType, Ok } from 'ioredis';
const redis = new Redis(process.env.REDIS_HOST);
export const set = async (
key: KeyType,
seconds: number,
value: Record<string, unknown>,
): Promise<Ok> =>
// https://redis.io/commands/psetex
@sindresorhus
sindresorhus / esm-package.md
Last active May 3, 2024 10:19
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@santospatrick
santospatrick / setup-mac.sh
Last active April 21, 2023 15:59
MacOSX Setup for Development
#!/usr/bin/env bash
# 1. Run this script file
# bash <(curl -Ls https://bit.ly/3swaoUr)
# Homebrew & Apps
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$USER/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew update
@nickgs
nickgs / erc20.json
Created February 19, 2021 21:49
ERC20 ABI
[
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}