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
//: 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 / 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}`,
),
);
}
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 / 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
@jason-shen
jason-shen / redis-install-guide.md
Created May 6, 2018 19:34
Install Redis on macOS Sierra via Homebrew

Install Redis on macOS Sierra via Homebrew

It's very simple to install Redis on macOS. Just follow the instructions below.

For the first you need to [install Homewbrew][0]. Then run the command below in you Terminal:

$ brew install redis

To get all info about this package run:

@jason-shen
jason-shen / sec_tutorial.md
Created May 7, 2018 03:34 — forked from tgrall/sec_tutorial.md
MongoDB Security Tutorial

#Simple MongoDB Security Tutorial

###1 - Start mongod without any "security option"

$ mongod --port 27017

@jason-shen
jason-shen / git-aliases.md
Created May 8, 2018 09:53 — forked from EQuimper/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@jason-shen
jason-shen / gist:3c68c3bdfe1f50053ca403e9c6f54e5e
Created May 8, 2018 09:54 — forked from EQuimper/gist:2b09f6b76bddf3c00d543c7c897dea14
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@jason-shen
jason-shen / .editorconfig
Created May 8, 2018 09:59 — forked from EQuimper/.editorconfig
My Editor Config Setup
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true