View MyComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react-native'); | |
var { | |
StyleSheet, | |
ListView, | |
ActivityIndicatorIOS, | |
Image, | |
// ... | |
} = React; | |
var { | |
Text, |
View Ferrisel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Ferrisel = React.createClass({ | |
getInitialState() { | |
return { | |
panX: new Animated.Value(0), | |
panY: new Animated.Value(0) | |
}; | |
}, | |
render() { | |
var { pages } = this.props; | |
var { panX, panY } = this.state; |
View InlineCssModule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Web; | |
/// <summary> | |
/// Removes CSS from rendered HTML page. | |
/// </summary> | |
public class InlineCssModule : IHttpModule | |
{ |
View User.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UserShape from '../shapes/UserShape'; | |
import UserCard from './UserCard'; | |
import UserBadge from './UserBadge'; | |
export default class User extends React.Component { | |
static defaultProps = { | |
user: UserShape.requires(` | |
first_name, | |
last_name, | |
`) // the needs of *this* component |
View ko-convenience.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (ko, handlers, unwrap, extend) { | |
"use strict"; | |
extend(handlers, { | |
href: { | |
update: function (element, valueAccessor) { | |
handlers.attr.update(element, function () { | |
return { href: valueAccessor() }; | |
}); | |
} | |
}, |
View ReactComponentPropType.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ReactComponentPropType(props, propName, componentName, ...rest) { | |
const Component = props[propName]; | |
if (Component === undefined) return null; | |
if (typeof Component === 'function' && Component.prototype.isReactComponent) { | |
// it's a real react component | |
return null; | |
} else { | |
return new Error(`${componentName}.${propName} is expected to be a React component.`); | |
} | |
} |
View bridgeDebugger.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file allows us to inspect the traffic going over the Native <-> JS bridge, and can be | |
// helpful for debugging. Setting this to true should never be committed to git | |
const ENABLE_BRIDGE_DEBUGGER = false; // <-- THIS SHOULD NOT BE TRUE IN MASTER!!!! | |
// if true, function arguments will get pretty printed | |
const PRETTY_PRINT = false; | |
// enable this if you want to ignore EVERY event, except for the ones that match the `FOCUSED_*` | |
// constants. If true, you configure what you want to see. If false, you configure what you DONT | |
// want to see. |
View i18n-tag.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function t(strings, ...values) { | |
const string = strings.reduce((s, next, i) => `${s}%{${i}}${next}`); | |
return new IntlMessageFormat(string, 'en-us').format(values); | |
} | |
const person = 'Mike'; | |
const age = 28; | |
console.log(t`${person} is age ${age}`); |
View find-rn-imports.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const walk = require('babylon-walk'); | |
const babylon = require('babylon'); | |
const glob = require('glob'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const zip = (a, b, fn) => a.forEach((el, i) => fn(el, b[i], i)); | |
const promisify = fn => new Promise((res, rej) => { | |
const done = (err, val) => (err ? rej(err) : res(val)); |
View eachAsync.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function eachAsync(iter, list, delay) { | |
var i = 0, | |
stopped = false, | |
fwhenDone; | |
delay = delay || 0; | |
function run() { | |
iter(list[i], done); | |
} | |
function hold() { |
OlderNewer