Skip to content

Instantly share code, notes, and snippets.

@Reston
Reston / gist:9aaf5b25b79cc7bafc16ef88a208eb73
Created April 4, 2022 16:17
git filter-repo borrar información sensible de forma sencilla
# Forma actual para borrar datos sensibles de GIT en commits recientes
## Usando *git filter-repo* y solo cambiando la rama actual (en menos de 1 minuto)
mkdir backup_repo
# 1. Clonar repo fresco desde origin y entrar a la rama
git clone git@github.com:Company/repo_a_modificar.git
cd repo_a_modificar
git checkout feature/nombre_de_la_rama
import * as React from 'react';
import AsyncStorage from '@react-native-community/async-storage';
export default function App({ navigation }) {
const [state, dispatch] = React.useReducer(
(prevState, action) => {
switch (action.type) {
case 'RESTORE_TOKEN':
return {
...prevState,
@Reston
Reston / reducer.js
Created July 15, 2020 14:25
Structure for useReducer with persist data
// forked from Cristobal Aguirre at https://dev.to/selbekk/persisting-your-react-state-in-9-lines-of-code-9go
const initialState = {
//other state
cartItems: JSON.parse(localStorage.getItem('cart_items')) || [],
}
function reducer(state, action) {
switch (action.type) {
case 'UPDATE_CART': {