There are 5 main commands you'll use with git.
git pull
- download any new changes made by other people from the shared repository on GitHub
git push
- upload any new changes that you made on your local repository to the shared repository
import React, { Component } from 'react' | |
import { connect } from 'react-redux' | |
import * as TabContentUtils from '../utils/TabContentUtils' | |
class Editor extends Component { | |
... | |
} | |
const ConnectedClass = connect()(Editor) |
import { AppRegistry } from 'react-native' | |
let entry = require('actual-entry-file.js') | |
// Check if we're dealing with ES6-style imports | |
if (typeof entry === 'object' && entry !== null && entry._esModule) { | |
// If we are, pick the default import | |
entry = entry.default | |
} |
export * as testActions, { at as testConstants } from './testActions' |
const sceneData = { | |
scenes: [ | |
{id: '1', x: 0, y: 0, width: 375, height: 667}, | |
{id: '2', x: 400, y: 0, width: 375, height: 667}, | |
{id: '3', x: 800, y: 0, width: 375, height: 667}, | |
], | |
connections: [ | |
{from: '1', to: '3', label: 'onPress'}, | |
{from: '2', to: '1', label: 'onPress'}, |
window.Test = { | |
getText: function() { | |
return 'Hello, World!' | |
} | |
} |
import React, { Component } from 'react' | |
import { View } from 'react-native' | |
export default class {{{filename}}} { | |
constructor() { | |
super() | |
this.state = {} | |
} | |
} |
import React, { Component, } from 'react' | |
import { | |
View, | |
Image, | |
Text, | |
Dimensions, | |
ScrollView, | |
} from 'react-native' | |
const {height, width} = Dimensions.get('window') |
const once = require('once') | |
const fork = require('child_process').fork | |
class npm { | |
static run(cmd = [], opts = {}, cb) { | |
cb = once(cb) | |
console.log('run npm with', cmd, opts) | |
var stdout = '' |
# Scroll to the nearest page | |
nearestPage = (layerCount, pageSize, value, velocity) -> | |
# Scroll position is negative... easier to think in terms of positive values | |
value = - value | |
lowerPageIndex = Math.max 0, Math.floor(value / pageSize) | |
upperPageIndex = Math.min (layerCount - 1), (lowerPageIndex + 1) | |
if velocity < -0.2 |