Skip to content

Instantly share code, notes, and snippets.

- Game: http://54.77.31.219/
- Last version video: https://www.youtube.com/watch?v=5H3Pu4WFZD4
- Community: https://plus.google.com/u/1/communities/105437932515232469714
const React = require('react');
// Have some complicated non-React widgets that manipulate DOM?
// Do they manage a list of DOM elements? Here's how to wrap it
// into a React component so you can "constantly rerender" it.
// A dumb non-react widget that manually manage some DOM node that
// represent a list of items
function NonReactWidget(node) {
this.node = node;
import React from 'react-native'
var {
Image,
Animated,
View
} = React
module.exports = React.createClass({
getInitialState() {
<br /><br />
# React Native: Animated
ReactEurope 2015, Paris - Spencer Ahrens - Facebook
<br /><br />
## Fluid Interactions
- People expect smooth, delightful experiences
@nishp1
nishp1 / React Native: Animated - Code
Created February 28, 2016 16:13 — forked from sahrens/React Native: Animated - Code
Example code from ReactEurope 2015 talk - React Native: Animated
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
@nishp1
nishp1 / animations.js
Created March 20, 2016 01:55 — forked from vdel26/animations.js
Custom Scene transition
import { Navigator } from 'react-native';
import PixelRatio from 'PixelRatio';
import Dimensions from 'Dimensions';
import buildStyleInterpolator from 'buildStyleInterpolator';
// use FloatFromRight as starting template
const BaseConfig = Navigator.SceneConfigs.FloatFromRight;
// create custom navigator transition
@nishp1
nishp1 / firebase-util.js
Created March 20, 2016 04:49 — forked from asciimike/firebase-util.js
Firebase Friend List with Presence and Idle
/*! Firebase-util - v0.1.2 - 2014-01-11
* https://github.com/firebase/firebase-util
* Copyright (c) 2014 Firebase
* MIT LICENSE */
(function(exports) {
/**
* @var {Object} a namespace to store internal utils for use by Firebase.Util methods
*/
@nishp1
nishp1 / README.md
Created April 4, 2016 00:06 — forked from boopathi/README.md
Creating a Swift-ReactNative project

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"rc-start": "npm start -- --reset-cache",
"clean": "rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean",
"clean-start": "npm run clean && npm run rc-start",
"fresh-install": "rm -rf $TMPDIR/react-* && watchman watch-del-all && rm -rf ios/build/ModuleCache/* && rm -rf node_modules/ && npm cache clean && npm install",
"fresh-start" : "npm run fresh-install && npm run rc-start",
"tron": "node_modules/.bin/reactotron"
}
@nishp1
nishp1 / Infrastructure.js
Created August 29, 2018 18:58 — forked from sebmarkbage/Infrastructure.js
SynchronousAsync.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
}
if (pending.has(url)) {
throw pending.get(url);
}