Skip to content

Instantly share code, notes, and snippets.


Bruno Lemos brunolemos

Block or report user

Report or block brunolemos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
brunolemos / v1.tsx
Created Dec 17, 2019
View v1.tsx
import { useEffect, useRef } from 'react'
export function useWhyDidYouUpdate(name: string, props: Record<string, any>) {
const latestProps = useRef(props)
useEffect(() => {
const allKeys = Object.keys({ ...latestProps.current, ...props })
const changesObj: Record<string, { from: any; to: any }> = {}
allKeys.forEach(key => {
brunolemos / App.tsx
Last active Nov 9, 2019
View App.tsx
import React from 'react'
import { StatusBar, Text, View } from 'react-native'
import { useSafeArea } from 'react-native-safe-area-context'
export function App() {
const safeAreaInsets = useSafeArea()
return (
# Darkify Slack on Mac OS:
# Thanks to:
if [ -z "`grep tt__customCss ${SLACK_INTEROP_JS}`" ]; then
# Backup original CSS for reverts:
echo 'document.addEventListener("DOMContentLoaded",function(){let tt__customCss=`body{background:#222;color:#e6e6e6}a{color:#949494}a:link,a:visited{color:#949494}a:active,a:focus,a:hover{color:#c7c7c7}hr{border-bottom:1px solid #424242;border-top:1px solid #222}h1,h2,h3,h4{color:#e6e6e6}h1 a{color:#e6e6e6}h1 a:active,h1 a:hover,h1 a:link,h1 a:visited{color:#e6e6e6}.bordered{border:1px solid #363636}.top_border{border-top:1px solid #363636}.bottom_border{border-bottom:1px solid #363636}.left_border{border-left:1px solid #363636}.right_border{border-right:1px solid #363636}.bullet{color:#949494}.alert,.c-alert,.c-alert--bo
brunolemos / ExampleComponent.tsx
Last active May 24, 2019
Redux + TypeScript - Strongly Typed
View ExampleComponent.tsx
import React from 'react'
import { Button, Text, View } from 'react-native'
import { useReduxAction } from '../hooks/use-redux-action'
import { useReduxState } from '../hooks/use-redux-state'
import * as actions from '../redux/actions'
import * as selectors from '../redux/selectors'
export function LoginScreen() {
const user = useReduxState(selectors.currentUserSelector)
brunolemos / TouchableScale.tsx
Created Sep 21, 2018
Touchable component with Scale effect, common on iOS 12 (works on mobile and web)
View TouchableScale.tsx
// Demo:
import React from 'react'
import { Animated, StyleProp, TouchableWithoutFeedback, TouchableWithoutFeedbackProps, ViewStyle } from 'react-native'
import { styleMerge } from 'shared/src/utils'
export interface TouchableScaleProps extends TouchableWithoutFeedbackProps {
containerStyle?: StyleProp<ViewStyle>
brunolemos / PlatformTouchable.tsx
Last active Sep 28, 2019
TypeScript version of react-native-platform-touchable
View PlatformTouchable.tsx
// Source:
import React, { PureComponent, ReactNode } from 'react'
import {
brunolemos / Example.jsx
Last active Jan 12, 2018
[react-native] Cross-platform TabView component with unified API for SegmentedControl (iOS default) and scrollable tabs (Android default)
View Example.jsx
// Live demo:
import React, { Component } from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import { Constants } from 'expo';
import TabView from './components/TabView';
const routes = [{ index: 0, title: 'Tab 0' }, { index: 1, title: 'Tab 1' }];
brunolemos / App.js
Last active Dec 10, 2017
HoC with custom prop name
View App.js
export default class App extends PureComponent...
brunolemos / Xcode Build Phases
Created Nov 22, 2017
React Native with Source Maps
View Xcode Build Phases
# Xcode > Build Phases > Bundle React Native code and images
export NODE_BINARY=node

Keybase proof

I hereby claim:

  • I am brunolemos on github.
  • I am brunolemos ( on keybase.
  • I have a public key whose fingerprint is CCB7 2FCA 5650 3F50 EEB4 F796 0A8E 45A6 ACE6 6963

To claim this, I am signing this object:

You can’t perform that action at this time.