Skip to content

Instantly share code, notes, and snippets.

@interface UIResponder (FirstResponder)
+ (id)currentFirstResponder;
@end
@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",
@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 / setup.md
Last active February 16, 2024 09:05
Setup a Linux Server

Initial Server Setup with Ubuntu 14.04

1. Root Login

Log into your server as root.

ssh root@your-server-ip-address
@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 / .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 / create_merge_request.rb
Created December 27, 2016 07:49
A fastlane action to create a new merge request on GitLab
module Fastlane
module Actions
module SharedValues
CREATE_MERGE_REQUEST_WEB_URL = :CREATE_MERGE_REQUEST_WEB_URL
end
class CreateMergeRequestAction < Action
def self.run(params)
require 'excon'