Skip to content

Instantly share code, notes, and snippets.

View Hfreitas's full-sized avatar

Hebert Silva Hfreitas

  • Arco Educação
  • Salvador, Bahia, Brazil
View GitHub Profile
@agnoster
agnoster / README.md
Last active July 13, 2024 19:26
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@leocomelli
leocomelli / git.md
Last active July 20, 2024 02:05
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

@JLarky
JLarky / README.md
Last active July 10, 2024 13:22
Ultimate example of react context hook with nice type-safe (TypeScript) wrappers and reduced boilerplate by using `ReturnType`
@sibelius
sibelius / awsLamdbaExperience.md
Last active October 31, 2023 00:09
AWS Lamdba Learning Path - What do you need to learn about aws lambdas?
  • learn how to bundle backend using webpack in a single bundle (check this https://gist.github.com/jgcmarins/2860f547f5d785dce24ca0eadbe3abdd)
  • learn how to automate lamdba deploys using serveless or aws cdk (github actions)
  • learn how to configure and automate api gateway
  • learn how to automate tests lambdas using jest
  • learn how to configure, automate and use RDS Proxy to fast database workflow in lamdbas (also cache database connections)
  • how the performance gain using RDS Proxy over normal database usage
  • learn about cold start and lambda statefull (https://www.swyx.io/stateful-serverless/)
  • expose a CRUD api in lamdba
  • put everything on open source (github)
  • write a blog post about each of the topics above
@sibelius
sibelius / backendLearningPath.md
Created January 15, 2021 14:59
Backend Learning Path - Basics that you should learn
  • learn about basic database modelling, use excalidraw
  • learn how to connect to a database and performe queries
  • learn how to expose a CRUD API REST and/or GraphQL
  • learn how to document the API using Swagger, swagger-jsdoc is the best for it
  • learn how to test your API using Postman, and also automated using jest and supertest
  • learn how to consume other APIs using fetch

Also check Docker Learning Path and Lambda Learning Path

@danieljpgo
danieljpgo / useSafeDispatch.js
Created January 30, 2021 14:37
useSafeDispatch hook
export const useSafeDispatch = dispatch => {
const mountedRef = React.useRef(false)
React.useLayoutEffect(() => {
mountedRef.current = true
return () => {
mountedRef.current = false
}
}, [])
function asyncReducer(state, action) {
switch (action.type) {
case 'pending': {
return {...state, status: 'pending', data: null, error: null}
}
case 'resolved': {
return {...state, status: 'resolved', data: action.data, error: null}
}
case 'rejected': {
return {...state, status: 'rejected', data: null, error: action.error}
@sibelius
sibelius / apiLog.ts
Created April 13, 2021 15:01
fetch api with log
export const apiWithLog = (init, options) => {
const end = timeSpan();
return fetch(init, options).then(async (response) => {
const durationTime = end();
const text = await response.text();
let json;
try {