Skip to content

Instantly share code, notes, and snippets.

@brunolemos
brunolemos / Xcode Build Phases
Created November 22, 2017 08:23
React Native with Source Maps
# Xcode > Build Phases > Bundle React Native code and images
export NODE_BINARY=node
./react-native-xcode.sh
@brunolemos
brunolemos / keybase.md
Created February 6, 2017 21:57
Keybase proof

Keybase proof

I hereby claim:

  • I am brunolemos on github.
  • I am brunolemos (https://keybase.io/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:

@brunolemos
brunolemos / debounce.js
Created December 20, 2016 00:53
React Debounce Render
// usage:
// export default debounce(100)(MyComponent);
import React from 'react';
import debounce from 'lodash/debounce';
export default (interval, ...debounceArgs) => {
if (typeof interval !== 'number' && interval > 0) {
throw new Error('[debounce] Interval (ms) parameter not received.');
}
@brunolemos
brunolemos / ListView.js
Last active November 24, 2017 14:26
React Native - ListView receiving data as a prop <ListView data={[1,2,3]} />
import React from 'react';
import { ListView } from 'react-native';
export default class extends React.PureComponent {
constructor(props) {
super(props);
const { data, dataSource, rowHasChanged: _rowHasChanged } = props;
this.state.data = data || [];
@brunolemos
brunolemos / destructuring.js
Last active September 14, 2016 16:34 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];