Skip to content

Instantly share code, notes, and snippets.

View tcodes0's full-sized avatar
💭
What's happening?

Thomazella Ribeiro tcodes0

💭
What's happening?
View GitHub Profile
@tcodes0
tcodes0 / async-await react 1
Last active April 20, 2020 18:15
async-await react-native 1
/**
* react-native project
*/
class HeartButton extends Component<Props, State> {
handlePress = async e => {
if (this.state.saving) {
return
}
this.setState({
@tcodes0
tcodes0 / react-native-0.62-upgrade-tips.txt
Last active March 31, 2020 12:17
react-native 0.62 upgrade tips
BLOCKERS:
If you use react-native-fbads, it doesn't build on android 0.62.
Either wait fix or remove.
I've openned an issue already: https://github.com/callstack/react-native-fbads/issues/244
Some libs are also giving the Error "Super expression must either be null or a function"
You should open an issue and look for a PR that fixes it, or fix it yourself.
Example of a PR fixing this issue: https://github.com/expo/react-native-action-sheet/pull/162
To install a dep from a github PR, add to package.json:
@tcodes0
tcodes0 / rsync-bkp-by-NuSkool
Created January 16, 2020 12:51
rsync linux backup by NuSkool
#!/bin/bash
# script by arch forums user NuSkool
UZR=$(getent passwd 1000 | awk -F':' '{print $1}')
Pdate=$(date '+%m-%d-%Y')
Buplog="/home/${UZR}/Desktop/${Pdate}".backup
ROOTdev="/dev/sdc1"
HOMEdev="/dev/sdc3"
touch "${Buplog}"
@tcodes0
tcodes0 / investimentos-by-@hnordt
Created December 8, 2019 16:13
investimentos simples by @hnordt
receitinha de bolo basica pra investir de maneira simples, pagando o minimo de taxas, e evitando fazer timing do mercado:
renda fixa:
curtissimo prazo (0 a 6 meses): cdb liquidez diaria
curto prazo (6 meses a 2 anos): lci lca
medio prazo (2-5 anos): cdbs com vencimentos fazendo ladeira
renda variavel (longo prazo, nao compre pensando em vender):
se for investir no brasil, compre um etf indexado pelo indice ibov todo mes
se for investir no exterior, compre um etf como aok (conservador), aom (moderado), aor (moderado agressivo) ou aoa (agressivo) dependendo do teu perfil de risco, todo mes
na renda fixa vc investe de 5 a 10 anos do seu custo mental de vida, como se fosse um fundo de emergencia, na renda variavel vc investe tudo q sobrar depois disso, sempre pensando em viver de dividendos, se vc compra uma acao ou etf pra vender, vc ta especulando, nao investindo, ai ja eh outro tipo de estrategia (edited)
@tcodes0
tcodes0 / links-and-cool-hacks.txt
Last active February 7, 2024 16:07
LINKS AND COOL HACKS
@tcodes0
tcodes0 / testfile.tsx
Created November 14, 2019 18:07
testfile (relay RTL found router)
test.only('it works', async () => {
const environment = createMockEnvironment();
const ComponentWithRouter = await mountWithRouter(LoginComponent, environment);
const { getByPlaceholderText, queryByText, getByTestId } = render(
<RelayEnvironmentProvider environment={environment}>
<ThemeProvider theme={theme}>{ComponentWithRouter}</ThemeProvider>
</RelayEnvironmentProvider>,
);
// Inject some input into component
@tcodes0
tcodes0 / mountWithRouter.tsx
Last active November 14, 2019 18:09
mountWithRouter.tsx
import * as React from 'react';
import { createRender, resolver as defaultResolver, getStoreRenderArgs } from 'found';
import createFarceStore from 'found/lib/utils/createFarceStore';
import { FarceElementResult, FarceRedirectResult, GetFarceResultArgs } from 'found/lib/server';
import queryMiddleware from 'farce/lib/queryMiddleware';
import BrowserProtocol from 'farce/lib/BrowserProtocol';
import RouterProvider from 'found/lib/server/RouterProvider';
import FarceActions from 'farce/lib/Actions';
import { Resolver } from 'found-relay';
import { RelayModernEnvironment } from 'relay-runtime/lib/store/RelayModernEnvironment';
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
@tcodes0
tcodes0 / testing-lib-render-returns
Created November 7, 2019 18:02
all testing lib helpers returned by render
container: HTMLDivElement { _reactRootContainer: [ReactSyncRoot] },
baseElement: HTMLBodyElement {},
debug: [Function: debug],
unmount: [Function: unmount],
rerender: [Function: rerender],
asFragment: [Function: asFragment],
queryAllByLabelText: [Function: bound queryAllByLabelText],
getAllByLabelText: [Function: bound getAllByLabelText],
queryByLabelText: [Function: bound ],
findAllByLabelText: [Function: bound ],
@tcodes0
tcodes0 / console.log-interpolation
Created October 31, 2019 15:50
console log interpolation c style
port = 8001
host = localhost
console.log("Example app listening at http://%s:%s", host, port)
// Example app listening at http://localhost:8001
// Carbon
// https://carbon.now.sh/?bg=rgba(171%2C%20184%2C%20195%2C%201)&t=seti&wt=none&l=auto&ds=true&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=56px&ph=56px&ln=false&fl=1&fm=Hack&fs=14px&lh=133%25&si=false&es=2x&wm=false&code=port%2520%253D%25208001%250Ahost%2520%253D%2520localhost%250Aconsole.log(%2522Example%2520app%2520listening%2520at%2520http%253A%252F%252F%2525s%253A%2525s%2522%252C%2520host%252C%2520port)%250A%252F%252F%2520Example%2520app%2520listening%2520at%2520http%253A%252F%252Flocalhost%253A8001