Skip to content

Instantly share code, notes, and snippets.

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

Raphael "Thom" Thomazella tcodes0

💭
What's happening?
View GitHub Profile
## iOS emphasis
We'll be focusing on getting the ins and outs of iOS apps because that's what we do better.
## The simulator
The simulator is the development tool we use to simulate an iPhone.
### What you should know:
@tcodes0
tcodes0 / quit-work.sh
Last active January 26, 2019 02:23
quit working
#! /usr/bin/env bash
# quit working
osascript -e 'quit app "React Native Debugger"' 2>/dev/null
osascript -e 'quit app "Terminal"'
osascript -e 'quit app "iTunes"'
osascript -e 'quit app "Simulator"'
osascript -e 'quit app "Xcode"'
osascript -e 'quit app "Slack"'
osascript -e 'quit app "Google Chrome"'
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "alt+tab",
"command": "editor.action.reindentlines",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+;",
"command": "editor.action.commentLine",
import throttle from 'lodash/throttle';
import { useRef, useEffect, useCallback } from 'react';
export default function useThrottle(func, time = 1000) {
const throttleRef = useRef();
const callbackRef = useRef();
useEffect(() => {
callbackRef.current = func;
}, [func]);
@tcodes0
tcodes0 / lazy git
Last active August 19, 2019 18:07
lazy git function with commilint style messages
#! /usr/bin/env bash
# LAZY GIT
# with commitlint automation. Does git add --all and builds commit message:
# lg foo bar -> chore(misc): foo bar
# lg chore bar -> chore(misc): bar
# lg chore app: fix stuff -> chore(app): fix stuff
lg() {
local args="$*"
local commitTypes=(build ci chore docs feat fix perf refactor revert style test)
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
#!/usr/bin/env bash
# packager
adb reverse tcp:8081 tcp:8081
adb -d reverse tcp:8081 tcp:8081
adb -e reverse tcp:8081 tcp:8081
echo "🚧 React Native Packager Redirected 🚧"
@tcodes0
tcodes0 / gist:0d65057f6bf58164487c0fd9413bb5ef
Created September 6, 2019 13:39
debug jest test node vscode
// configurations is an array of objects
// add the object, select "Jest Tests" in debugger GUI (on the top left), add a breakpoint and hit F5! :rocket:
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Tests",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"args": ["-i"],
@tcodes0
tcodes0 / gist:eff08efa971361b2c965c6b107a53a7d
Last active November 4, 2019 14:11
update mongodb to community - brew
brew uninstall mongodb
brew tap mongodb/brew
brew install mongodb-community
# se vocês rodam o mongo sempre que ligam o mac rodem o comando a baixo também
# auto start service on login
brew services start mongodb-community
credits :twitter: @arthurdandrea
@tcodes0
tcodes0 / fetch-error.js
Created September 8, 2019 17:59
fetch-error-treatment
const fetchPayloadFrom = async response => {
if (response.status >= 200 && response.status < 300) {
const json = await response.json();
return json;
} else {
const bodyResp = await response.text();
const error = new Error(bodyResp);
error.status = response.status;
error.statusText = response.statusText;
throw error;