Skip to content

Instantly share code, notes, and snippets.

@yimingtang
yimingtang / hello.c
Created June 24, 2014 09:57
Hello World
#include <stdio.h>
int main(void)
{
printf("Hello World\n");
return 0;
}
@yimingtang
yimingtang / setup.md
Last active August 29, 2015 14:24
Setup a Mac for iOS Development
  • Open Mac App Store and update all apps
  • Install Xcode
  • Install iTerm 2
  • Install Homebrew
  • Install zsh
  • Install Oh My Zsh
  • Install RVM
  • Install latest Ruby
  • Install Sublime Text 3
  • Install GitHub for Mac
@yimingtang
yimingtang / NSBundle+MyLibrary.h
Last active August 29, 2015 14:27
NSBundle + Framework
//
// NSBundle+MyLibrary.h
// Pods
//
// Created by Yiming Tang on 8/4/15.
// Copyright (c) 2015 Yiming Tang. All rights reserved.
//
@import Foundation;
@yimingtang
yimingtang / UIImage+MyLibrary.h
Created August 9, 2015 13:31
UIImage+MyLibrary
//
// UIImage+MyLibrary.m
//
// Created by Yiming Tang on 7/9/15.
// Copyright (c) 2015 Yiming Tang. All rights reserved.
//
@import UIKit;
@interface UIImage (MyLibrary)
@yimingtang
yimingtang / preferences.json
Last active December 26, 2015 09:49
Sublime Text 2 config
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"draw_white_space": "all",
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb",
@interface UIResponder (FirstResponder)
+ (id)currentFirstResponder;
@end
@yimingtang
yimingtang / UIViewController+Topmost.h
Last active February 24, 2016 03:28
Find the topmost view controller
//
// UIViewController+Topmost.h
//
// Created by Yiming Tang on 13-10-14.
// Copyright (c) 2013 Yiming Tang. All rights reserved.
//
@interface UIViewController (Topmost)
+ (UIViewController *)topmostViewController;
@yimingtang
yimingtang / .vimrc
Last active February 24, 2016 03:29
vimrc
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" ================ General Config ====================
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
@yimingtang
yimingtang / like.json
Last active August 14, 2017 10:55
Like animation
{"v":"4.10.1","fr":30,"ip":0,"op":28,"w":1242,"h":2208,"nm":"预合成 3","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"形状图层 1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":20,"s":[100],"e":[0]},{"t":28}],"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[-25]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":6,"s":[-25],"e":[-10]},{"t":10}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[548,1172,0],"e":[548,1150,0],"to":[0,-3.66666674613953,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":6,"s":[548,1150,0],"e":[548,1172,0],"to":[0,0,0],"ti":[0,-3.66666674613953,0]},{"t":8}],"ix":2},"a":{"a":0,"k":[-154,60,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0
@yimingtang
yimingtang / on-pegasus-3.md
Last active October 13, 2017 03:16
On Pegasus: Part 3

Pegasus:基于 React Native 的 App 动态化方案(下)

上期,我们介绍了 RN 中 JS 和 native 的通信方案,并以 native library 形式在我们的 app 内顺利集成了 RN 模块。今天我们继续讨论:

  1. RN 模块对外依赖的解决方案;
  2. RN 模块的开发和调试问题;
  3. RN 模块代码的动态部署问题。

对外依赖