Skip to content

Instantly share code, notes, and snippets.

View sugarmo's full-sized avatar
🏠
Working from home

Steven Mok sugarmo

🏠
Working from home
View GitHub Profile
#**********************************************************************
# 09.07
# 2020年9月7日23:29:32
# 转载需要注明版权和来源
#
# 屏蔽常用网站、视频、手机rom广告&运营商劫持广告&数据跟踪&开屏广告
#
# 参照lhie1的surge规则改编,致谢!! https://github.com/lhie1/Surge
# 参照scomper的surge规则改编,致谢!! https://gist.github.com/scomper/915b04a974f9e11952babfd0bbb241a8/revisions
#
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
@sugarmo
sugarmo / InteractiveVisorViewController.swift
Created December 24, 2019 09:41 — forked from quantcon/InteractiveVisorViewController.swift
How to use UIPercentDrivenInteractiveTransition in one file
//
// ViewController.swift
// Interactive Animated Presentation
// "Visor" Effect
//
import UIKit
class ViewController: UIViewController {
@sugarmo
sugarmo / simctl.sh
Created December 12, 2019 09:48
Xcode 控制状态栏
xcrun simctl status_bar <device> [list | clear | override <override arguments>]
@sugarmo
sugarmo / ExtensionNamespace.swift
Last active September 1, 2018 04:29
Swift Extension with Namespace
public protocol NamespaceWrappable {
associatedtype T
var ex: T { get }
static var ex: T.Type { get }
}
extension NamespaceWrappable {
public var ex: TypeWrapper<Self> {
return TypeWrapper(value: self)
}
@sugarmo
sugarmo / sugarbash.sh
Last active May 21, 2018 05:46
An useful bash source file for Mac OS X.
# 我的命令库
# 编辑命令
sg-cmdedit() {
subl ~/Documents/sugarbash.sh
}
# 重新加载命令
sg-cmdreload() {
source ~/Documents/sugarbash.sh
@sugarmo
sugarmo / gist:987f9b058d0b23747ebb
Created May 14, 2014 09:18
Force Device to Rotate
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
objc_msgSend([UIDevice currentDevice], @selector(setOrientation:), newOrientation);
}
@sugarmo
sugarmo / find-unused-images
Created January 17, 2014 09:29
Find unused images
#!/bin/bash
# Escape code
esc=`echo -en "\033"`
# Set colors
cc_red="${esc}[0;31m"
cc_green="${esc}[0;32m"
cc_yellow="${esc}[0;33m"
cc_blue="${esc}[0;34m"
@interface Person : NSObject
@property (nonatomic, copy) NSMutableArray *friendNames;
@end
@implementation Person
- (id)init{
self = [super init];
@sugarmo
sugarmo / switch-xcode.sh
Created October 16, 2013 06:11
Switch Xcode.
sudo xcode-select -switch /Applications/Xcode.app