Skip to content

Instantly share code, notes, and snippets.

View jason-shen's full-sized avatar
🗼
Coding........

Jason Shen jason-shen

🗼
Coding........
View GitHub Profile
@jason-shen
jason-shen / install_elixir_phoenix.sh
Created April 30, 2018 16:17 — forked from ryanwinchester/install_elixir_phoenix.sh
Install Elixir and Phoenix on macOS
# Update brew
brew update
# Need postgres
brew install postgresql
# Install elixir
brew install elixir
# Install hex package manager
ExceptionsManager.js:73 Unhandled error GraphQL error: Unauthorized Error: GraphQL error: Unauthorized
at new ApolloError (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:95816:32)
at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:96688:45
at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:97067:21
at Array.forEach (native)
at http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:97066:20
at Map.forEach (native)
at QueryManager.broadcastQueries (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:97062:26)
at Object.next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:97102:35)
at SubscriptionObserver.next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:98761:22)
@jason-shen
jason-shen / error catching
Created March 31, 2018 17:25
apollo client
export const client = new ApolloClient({
link: ApolloLink.from([
onError(({ graphQLErrors, networkError }) => {
if (graphQLErrors) {
graphQLErrors.map(({ message, locations, path }) =>
console.log(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`,
),
);
}
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
let titleLabel = UILabel()
let captionLabel = UILabel()
let coverImageView = UIImageView()
let backgroundImageView = UIImageView()
@jason-shen
jason-shen / clear.txt
Created March 16, 2018 13:56 — forked from EQuimper/clear.txt
React-Native clear Watchman + Cache
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache
@jason-shen
jason-shen / .gitconfig
Last active March 16, 2018 14:21 — forked from EQuimper/.gitconfig
My .gitconfig
[user]
name = jason-shen
email = [email protected]
[alias]
c = commit -m
i = init
s = status
graph = log --graph --oneline --decorate=short --branches='*'
br = branch
// @flow
import React, { Component } from 'react';
import {
RefreshControl,
FlatList,
View,
ActivityIndicator,
} from 'react-native';
import { NavigationActions } from 'react-navigation';
import { normalize } from 'normalizr';
import { Feed, Photo } from '../utils/api';
import { arrayOfPhotos } from './normalizr_schema';
export const FETCH_FEED_IMAGES = 'FETCH_FEED_IMAGES';
export const FETCH_FEED_IMAGES_SUCCESS = 'FETCH_FEED_IMAGES_SUCCESS';
export const FETCH_FEED_IMAGES_ERROR = 'FETCH_FEED_IMAGES_ERROR';
photos_list = [
"https://freestocks.org/fs/wp-content/uploads/2018/01/english_bulldog_lying_on_a_sofa_2-800x533.jpg",
"https://freestocks.org/fs/wp-content/uploads/2017/04/old_tile_stove_fire-800x533.jpg",
"https://freestocks.org/fs/wp-content/uploads/2017/10/trip_in_the_mountins_with_a_dog-733x1100.jpg",
"https://freestocks.org/fs/wp-content/uploads/2016/08/french_fries-800x533.jpg",
"https://freestocks.org/fs/wp-content/uploads/2016/09/memory_box_2-800x533.jpg",
"https://freestocks.org/fs/wp-content/uploads/2016/10/sailing_boat_at_sunset-450x300.jpg",
"https://freestocks.org/fs/wp-content/uploads/2016/11/playground_ropes-800x533.jpg",
"https://freestocks.org/fs/wp-content/uploads/2016/11/fig_cake_2-800x533.jpg",
"https://freestocks.org/fs/wp-content/uploads/2017/12/christmas_tree_decoration_3-800x533.jpg",