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 / 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 / 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 / gist:e84632fa2f5affb6111f8457779a14b7
Last active April 20, 2020 18:15
async-await react-native 2
/**
* react-native project
*/
class HeartButton extends Component<Props, State> {
handlePress = async e => {
const { data } = await apolloMutation1({
variables
})
navigation.navigate('ChatScreen', { conversationId: data.conversation.id })
@tcodes0
tcodes0 / async-await-react-native-3.js
Last active April 20, 2020 18:41
async-await react-native 3
/**
* react-native
* React.FC
* loading state used for UI feedback only
* async handle attached to button with 3 awaits
* apollo mutation
* promisified calls
*/
const EmailConfirmation: React.FC<Props> = ({ navigation, dispatch, ...props }) => {
const [loading, setLoading] = useState(false)
real vs dolar 2020
https://twitter.com/thom_is_coding/status/1253373908650205185
@tcodes0
tcodes0 / dicas-mei-ir.js
Created June 29, 2020 17:34
Dicas para mei com imposto de renda
const totalYear = /* total de ganhos no ano */;
const SERVICES_TAX_ASSUMPTION = 0.32;
const EXEMPT_AMOUNT = 28.559.70 /* valor para 2020 */;
const nonTaxable = totalYear * SERVICES_TAX_ASSUMPTION;
const taxableByPj = totalYear - nonTaxable;
const shouldSubmitIR = taxableByPj > EXEMPT_AMOUNT;
console.log({ shouldSubmitIR, taxableByPj, nonTaxable, totalYear });
/**
https://www.msn.com/pt-br/dinheiro/other/mei-precisa-declarar-imposto-de-renda/ar-BB10w1xg
1 23º FloripaJS Devs Meetup
talk 45m "Objective-c tips for react native developers"
link: https://docs.google.com/presentation/d/1u5Lu_dDg9OA08fIWEs3XmgFB9PnV59UkTnvPfjDrQwQ/edit?usp=sharing
2 14º Encontro - ReactJS Florianópolis
talk 20m "React hooks"
junto com Arthur D'andrea https://github.com/arthurdandrea
3 15º Encontro - ReactJS Florianópolis
talk 45m "Patch-package, nodeify e browserify em react-native: codando node_modules"
link: https://docs.google.com/presentation/d/1cweWvAZz1sFJC4NJgMvNHQpaIBiMeO16og2xWJiIXwU/edit?usp=sharing
4 17º Encontro - ReactJS Florianópolis
@tcodes0
tcodes0 / ts-repl.ts
Last active July 8, 2020 19:05
Awesome Typescript REPL
import decache from 'decache'
import { watch, FSWatcher } from 'fs'
import REPL from 'repl'
type ReloadConfig = { newline?: boolean }
type JSObject<Value = any> = Record<string, Value>
const AUTO_RELOAD = true
/**
* path to the modules you'll be developing and reloading.
@tcodes0
tcodes0 / typescripting-twitter-snippets-part1.ts
Last active July 13, 2020 20:54
Typescripting Twitter snippets part 1
/*************************************************************
* https://twitter.com/marcelcruz/status/1282005231065341953 *
*************************************************************/
/**
* original js
*/
const capitalize = ([firstLetter, ...rest]) => {
return firstLetter.toUpperCase() + rest.join('')
}
@tcodes0
tcodes0 / owasp-notes.md
Last active July 17, 2020 07:32
security notes

SQL injection, injection in general

happens when user provided data is poorly or not validated at all. happens when the client is manipulated to send unexpected params to the backend. backend must avoid at all cost to use data in db requests or other operations if needed, data should be filtered and validated on the server side, better yet parametrized, or at the bare minimum, escaped properly

headers and env vars are possible vectors of attack