Skip to content

Instantly share code, notes, and snippets.

View dabit3's full-sized avatar
🎡
probably nothing

Nader Dabit dabit3

🎡
probably nothing
View GitHub Profile
@dabit3
dabit3 / app.js
Last active October 20, 2016 07:09
Apollo Tutorial - app
const express = require('express');
const bodyParser = require('body-parser');
const Mongoose = require('mongoose');
const PORT = 8080;
const app = express();
const { apolloExpress, graphiqlExpress } = require('apollo-server');
const { makeExecutableSchema } = require('graphql-tools');
Mongoose.Promise = global.Promise;
@dabit3
dabit3 / index.js
Last active October 23, 2016 19:45
Apollo Tutorial - index.js
import React from 'react'
import { AppRegistry } from 'react-native'
import App from './app'
import ApolloClient, { createNetworkInterface } from 'apollo-client';
import { ApolloProvider } from 'react-apollo'
const Client = () => {
const networkInterface = createNetworkInterface({
uri: 'http://localhost:8080/graphql'
@dabit3
dabit3 / App.js
Last active October 24, 2016 02:45
Apollo Tutorial - App.js
import React, { Component } from 'react'
import { View, Text, TextInput, StyleSheet } from 'react-native'
import { graphql } from 'react-apollo';
import gql from 'graphql-tag'
class App extends Component {
constructor() {
super()
this.state = {
@dabit3
dabit3 / NavigationCardStack.js
Last active December 8, 2016 22:04
Navigation Card Stack minimal implementation
import React, { Component } from 'react'
import { View, Text, NavigationExperimental } from 'react-native' // 1
const {
CardStack: NavigationCardStack, // 2
} = NavigationExperimental
let styles = {}
const Home = () => ( // 3
@dabit3
dabit3 / Navigation Card Stack implementation - 2
Last active December 7, 2016 20:49
NavigationCardStack.js
import React, { Component, PropTypes } from 'react'
import { View, Text, NavigationExperimental } from 'react-native'
const {
CardStack: NavigationCardStack,
} = NavigationExperimental
let styles = {}
const Home = ({ navigate }) => {
@dabit3
dabit3 / NavigationCardStack.js
Created December 7, 2016 21:03
Navigation Card Stack implementation - 3
import React, { Component, PropTypes } from 'react'
import { View, Text, NavigationExperimental } from 'react-native'
const {
CardStack: NavigationCardStack,
StateUtils: NavigationStateUtils,
} = NavigationExperimental
let styles = {}
@dabit3
dabit3 / index.ios.js
Created December 7, 2016 22:40
Navigation Card Stack implementation with Redux - index.ios.js
import React from 'react'
import { AppRegistry } from 'react-native'
import NavRootContainer from './NavRootContainer'
import configureStore from './configureStore'
import { Provider } from 'react-redux'
const store = configureStore()
const App = () => (
<Provider store={store}>
<NavRootContainer />
@dabit3
dabit3 / constants.js
Created December 7, 2016 22:42
Navigation Card Stack implementation with Redux - constants.js
export const PUSH_ROUTE = 'PUSH_ROUTE'
export const POP_ROUTE = 'POP_ROUTE'
@dabit3
dabit3 / navReducer.js
Last active December 8, 2016 22:00
Navigation Card Stack implementation with Redux - navReducer
import { NavigationExperimental } from 'react-native'
const {
StateUtils: NavigationStateUtils
} = NavigationExperimental
import { PUSH_ROUTE, POP_ROUTE } from './constants'
function navReducer(state, action) {
if (!state) {
return {
@dabit3
dabit3 / navActions.js
Created December 7, 2016 22:44
Navigation Card Stack implementation with Redux - navActions
import { PUSH_ROUTE, POP_ROUTE } from './constants'
export function push(route) {
return {
type: PUSH_ROUTE,
route
}
}
export function pop() {