Skip to content

Instantly share code, notes, and snippets.

View ide's full-sized avatar
πŸ“ˆ
My life is a hackathon

James Ide ide

πŸ“ˆ
My life is a hackathon
View GitHub Profile
@ide
ide / RouteWithEventEmitter.js
Last active April 13, 2016 00:11
Using an event emitter to communicate between the scene and navigation bar button
function getProfileRoute(user) {
let emitter = new EventEmitter();
return {
renderScene(navigator) {
let ProfileScreen = require('./ProfileScreen');
return (
<ProfileScreen
user={user}
navigator={navigator}
routeEvents={emitter}
@ide
ide / TopLevelNavigator.js
Created October 19, 2015 08:54
Example with a top-level navigator presenting a modal screen
class Root extends React.Component {
render() {
// Hide the navigation bar in the top-level navigator. The main route will
// render a nested navigator with its own navigation bar.
return (
<ExNavigator
showNavigationBar={false}
initialRoute={getMainRoute()}
/>
);
@ide
ide / HomeRouteWithFocus.js
Last active October 19, 2015 09:19
Showing the focus and blur methods on a route
function getHomeRoute() {
return {
// Implement onWillFocus, onDidFocus, onWillBlur, or onDidBlur
onWillFocus(event) {
// The event is the one from React Native's Navigator. See the source code
// for what properties it has.
},
};
}
@ide
ide / gist:60a5fb5a5352226a4e1e
Created November 19, 2015 03:53
React Native E2E test error
ide:react-nativeΒ·master$ ./scripts/e2e-test.sh
> crypt3@0.1.8 install /Users/ide/.nvm/versions/node/v4.2.1/lib/node_modules/sinopia/node_modules/crypt3
> node-gyp rebuild
CXX(target) Release/obj.target/crypt3/crypt3.o
In file included from ../crypt3.cc:7:
../node_modules/nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
^
@ide
ide / Babel.js
Created December 2, 2015 21:37
Decorators with Babel 6 and React Native
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
@ide
ide / ChildStyler.js
Created January 14, 2016 23:48
Applying styles to children
import React, {
StyleSheet,
} from 'react-native';
export default class ChildStyler extends React.Component {
render() {
return (
<View {...this.props}>
{React.Children.map(this.props.children, child => React.cloneElement(child, {
style: [child.props.style, styles.customChildStyle],
@ide
ide / Profile.js
Created January 16, 2016 03:15
Example React component file
/**
* @providesModule Profile
*/
'use strict';
import React, {
Image,
PropTypes,
StyleSheet,
Text,
@ide
ide / Universe
Last active October 10, 2017 00:34
View of the Expo Universe
.
β”œβ”€β”€ README.md
β”œβ”€β”€ experiences # Experiences built with Expo
β”‚Β Β  β”œβ”€β”€ ...
β”‚Β Β  β”œβ”€β”€ floatyplane
β”‚Β Β  β”œβ”€β”€ list
β”‚Β Β  └── ui-explorer
β”œβ”€β”€ ci # Scripts that automate testing and building
β”‚Β Β  └── ...
β”œβ”€β”€ dev # Tools for developers using or integrating w/Expo
@ide
ide / 1. Original Source .js
Last active September 2, 2016 20:04
Comparing Babel + Uglify with Babel + Babili (with pretty-printing, September 2016)
async function getTemperatureForecastAsync() {
let response = await fetch('/forecast.json');
let result = await response.json();
return result.temperature;
}
@ide
ide / keybase.md
Created June 17, 2017 21:11
keybase.md

Keybase proof

I hereby claim:

  • I am ide on github.
  • I am ide (https://keybase.io/ide) on keybase.
  • I have a public key ASAdOyeVcBhKU9rNeh3URMFoCh35vQWH5fnDi9HODfQ7swo

To claim this, I am signing this object: