Skip to content

Instantly share code, notes, and snippets.

View AugustoCalaca's full-sized avatar

Augusto Calaca AugustoCalaca

View GitHub Profile
@sibelius
sibelius / floatToCents.ts
Created September 29, 2021 16:32
convert a float to cents
export const floatToCents = (value: number): number => {
return parseInt((value * 100).toFixed(2), 10);
}
@Gabriel-Paulucci
Gabriel-Paulucci / nginxloadbalancer.conf
Created September 16, 2021 01:37
Nginx loadbalancer
upstream loadbalancer {
least_conn;
server 127.0.0.2 weight=5;
server 127.0.0.3 weight=5;
server 127.0.0.4;
server 127.0.0.5;
}
server {
listen 80;
@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
@sibelius
sibelius / mock-uuid.ts
Created August 30, 2021 16:06
mock uuid v4 unique and stable for tests
jest.mock('uuid', () => {
const base = '9134e286-6f71-427a-bf00-';
let current = 100000000000;
return {
v4: () => {
const uuid = base + current.toString();
current++;
return uuid;
@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

@enisdenjo
enisdenjo / graphiql-over-ws.html
Last active December 20, 2023 05:32
GraphiQL ❤️ graphql-ws
<!--
* Copyright (c) 2021 GraphQL Contributors
* All rights reserved.
*
* This code is licensed under the MIT license.
* Use it however you wish.
-->
<!DOCTYPE html>
<html>
<head>
@sibelius
sibelius / debugRelay.ts
Created April 7, 2021 02:13
debug relay utils
import prettyFormat from 'pretty-format';
const excludeKeys = ['__fragments', '__id', '__fragmentOwner'];
// strip __fragments, __id, __fragmentOwne
export const relayTransform = (key: string, value: string) => {
if (excludeKeys.includes(key)) {
return undefined;
}
@mrousavy
mrousavy / MEMOIZE.md
Last active April 22, 2024 19:26
Memoize!!! 💾 - a react (native) performance guide
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and  
returning the cached result when the same
inputs occur again.                                         
                                                     — wikipedia
@jgcmarins
jgcmarins / ReactNativeFormikExample.tsx
Last active April 5, 2021 00:49
React Native + Formik hooks example
import React from 'react'
import { FormikProvider, useFormik } from 'formik'
import * as yup from 'yup'
import TextInputFormik from './TextInputFormik'
const ReactNativeFormikExample: React.FC<unknown> = (props) => {
const formik = useFormik({
initialValues: {
name: '',
@sibelius
sibelius / entria.md
Last active April 22, 2021 01:05
Things that you gonna learn at Entria

Most job post are about requirements that you should already know.

We think that you should learn a lot when working for a company.

So here is a list of many things that you are going to learn while working for us (and many more):

  • how to use git to work in a team
  • how to contribute to open source projects
  • how to manage .env files (configurations)
  • local vs staging vs production environments