Skip to content

Instantly share code, notes, and snippets.

View yingmu52's full-sized avatar
🎯
Focusing

Tony Zhuang yingmu52

🎯
Focusing
  • Microsoft
  • Vancouver, BC
View GitHub Profile
@yingmu52
yingmu52 / rn-nav.js
Created July 20, 2017 04:30
Navigation example
import React from 'react';
import { StyleSheet, Text, View, Image, TextInput, Button } from 'react-native';
import { StackNavigator } from 'react-navigation';
class HomeScreen extends React.Component {
static navigationOptions = {
title: 'HomeScreen',
};
render() {
const { navigate } = this.props.navigation;
@yingmu52
yingmu52 / demo.swift
Last active August 19, 2017 03:03
MVVM Login Form Demo
import UIKit
import ReactiveSwift
import Result
import ReactiveCocoa
class TestVC: UIViewController {
@IBOutlet weak var emailTextField : UITextField!
@IBOutlet weak var nameTextField : UITextField!
@IBOutlet weak var passTextField : UITextField!
@yingmu52
yingmu52 / jsonMap.swift
Created August 21, 2017 16:29
Demo Mapping json using ObjectMapper
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let urlstring = "http://jsonplaceholder.typicode.com/posts"
Alamofire.request(urlstring).responseJSON { (data) in
let results = Mapper<Post>().mapArray(JSONObject: data.result.value)
for post in results! {
print(post.id)
@yingmu52
yingmu52 / session.md
Last active September 11, 2017 18:38
Guitar Session

List for next gig

10 Picks From Tony

@yingmu52
yingmu52 / go.md
Last active November 12, 2017 21:40
Setup Go Environment

Install & Setup

Note: all the go code should be inside this go folder

  • Set your GOPATH
@yingmu52
yingmu52 / setup.sh
Created November 16, 2017 00:21
setup
# Setup Git
git config --global alias.la '!git config -l | grep alias | cut -c 7-'
git config --global alias.br 'branch -vv'
git config --global alias.brd 'branch -D'
git config --global alias.cm 'commit -m'
git config --global alias.co 'checkout'
git config --global alias.coo 'checkout -'
git config --global alias.cob 'checkout -b'
git config --global alias.st 'status'
git config --global alias.pr 'pull --rebase upstream develop'
@yingmu52
yingmu52 / pantodismiss.swift
Last active January 18, 2018 18:43
Code Snippets
func panGestureAction(_ panGesture: UIPanGestureRecognizer) {
let translation = panGesture.translation(in: view)
if panGesture.state == .began {
originalPosition = view.center
originalPositionNC = navigationController?.navigationBar.center
currentPositionTouched = panGesture.location(in: view)
} else if panGesture.state == .changed {
if (translation.y > 0){
view.frame.origin = CGPoint(
@yingmu52
yingmu52 / deeplink.swift
Created February 25, 2018 06:52
Deep Linking
@yingmu52
yingmu52 / run.js
Last active February 27, 2018 06:14
http node
const https = require('https');
https.get('https://jsonplaceholder.typicode.com/posts/1', (resp) => {
  let data = '';
  resp.on('data', (chunk) => {    
data += chunk;
});
  resp.on('end', () => {
console.log(data)
  });
}).on("error", (err) => {
@yingmu52
yingmu52 / code-base.md
Last active March 16, 2018 20:08
Leet Code Restaurant Inc

Weekly Leet Code Challenage

Every week we will have an easy leet code question, posted on every friday. and on the same day we will share the code for the previous challenage :)

Weekly Leet Code 771. Jewels and Stones