git clone [email protected]:<your_username>/<repo_name>.git
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 setState = Component.prototype.setState | |
Component.prototype.setState = function(nextState) { | |
console.log(this.constructor.name, nextState) | |
return setState.apply(this, arguments) | |
} |
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 AnimatedTextInput = styled(Animated.createAnimatedComponent(RNTextInput))` | |
backgroundColor: transparent; | |
color: #000; | |
height: 48; | |
marginTop: 20; | |
paddingHorizontal: 0; | |
`; | |
//... | |
<AnimatedTextInput |
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
// @flow | |
import { GraphQLInt } from 'graphql'; | |
import { connectionDefinitions } from 'graphql-relay'; | |
import UserType from '../type/user/UserType'; | |
export default connectionDefinitions({ | |
name: 'User', | |
nodeType: UserType, | |
connectionFields: () => ({ |
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
// @flow | |
import { nodeDefinitions, fromGlobalId } from 'graphql-relay'; | |
import UserType from '../type/UserType'; | |
const { nodeInterface, nodeField, nodesField } = nodeDefinitions( | |
// A method that maps from a global id to an object | |
async (globalId, context, options) => { | |
const { id, type } = fromGlobalId(globalId); |
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 React from 'react'; | |
import { render } from 'react-dom'; | |
import Hello from './Hello'; | |
const styles = { | |
fontFamily: 'sans-serif', | |
textAlign: 'center', | |
}; | |
class AutoDestroy extends React.Component { |
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
type $If<X: boolean, Then, Else = empty> = $Call< | |
& ((true, Then, Else) => Then) | |
& ((false, Then, Else) => Else), | |
X, | |
Then, | |
Else, | |
>; | |
type $Not<X: boolean> = $If<X, false, true>; | |
type $And<X: boolean, Y: boolean> = $If<X, Y, false>; |
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
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" | |
# Delete the remote version of the current branch | |
unpublish = "!git push origin :$(git branch-name)" | |
# Delete a branch and recreate it from master — useful if you have, say, | |
# a development branch and a master branch and they could conceivably go |
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
This solution fixes the error caused by trying to run npm update npm -g
. Once you're finished, you also won't need to use sudo
to install npm modules globally.
Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.
OlderNewer