Skip to content

Instantly share code, notes, and snippets.

View nicolastinkl's full-sized avatar
🌏
Trading

Zeus nicolastinkl

🌏
Trading
View GitHub Profile
@nicolastinkl
nicolastinkl / gist:8b1aa7ffea9e0657fb660d1a19dd38a9
Created December 14, 2016 04:03
NSMutNSableDictionary (Safe)
@implementation NSMutNSableDictionary(Swizzing)
+ (void)load {
Class dictCls = NSClassFromString(@"__NSDictionaryM");
Method originalMethod = class_getInstanceMethod(dictCls, @selector(setObject:forKey:));
Method swizzledMethod = class_getInstanceMethod(dictCls, @selector(na_setObject:forKey:));
method_exchangeImplementations(originalMethod, swizzledMethod);
}
//// 检测微信OpenURL时回传参数和回调逻辑
@implementation UIApplication(MethodSwizzing)
static void MySetFrame(id self, SEL _cmd, NSURL* url);
static void (*SetFrameIMP)(id self, SEL _cmd, NSURL* url);
static void MySetFrame(id self, SEL _cmd, NSURL* url) {
// do custom work
NSLog(@" url : %@",url);
@nicolastinkl
nicolastinkl / gist:f776df448631a03d59e517c464ac1825
Created August 29, 2016 08:23
WeChat Delegate 汇编源码
char -[MicroMessengerAppDelegate handleOpenURL:bundleID:](void * self, void * _cmd, void * arg2, void * arg3) {
r7 = (sp - 0x4 - 0x4 - 0x4 - 0x4 - 0x4) + 0xc;
sp = sp - 0x4 - 0x4 - 0x4 - 0x4 - 0x4 - 0x4 - 0x4 - 0x4 - 0x64;
r11 = loc_e0b370(arg2, _cmd, arg2, arg3, stack[2048], stack[2049], stack[2050], stack[2051], stack[2052]);
stack[2067] = loc_e0b370(arg3);
r6 = 0x1e42556;
r10 = @selector(logWithLevel:module:errorCode:file:line:func:format:);
r0 = @class(iConsole);
r2 = @"url[%@]";
r3 = 0x73b;
@nicolastinkl
nicolastinkl / gist:8bcb8aeab976d6de6f2108ad12a56d02
Created July 20, 2016 03:12
ios 实时输出日志信息 命令行
1. func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool 在函数里添加
redirectConsoleLog()
/// redirect Log.
func redirectConsoleLog() {
#if DEBUG
let documentDir: String = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0]
print("documentPath : \(documentDir)")
@nicolastinkl
nicolastinkl / gist:edc15924cda2747a2e861e26c8aff2f4
Created June 21, 2016 09:25
Paint Code Free newest Version
链接: http://pan.baidu.com/s/1eR1rz5C 密码: irbm
http://www.paintcodeapp.com/documentation 文档
@nicolastinkl
nicolastinkl / gist:b049c3e4ec0e4831c047
Created March 23, 2016 08:33
ios 雷达效果 水波效果
//
//
#import "LPViewController.h"
@interface LPViewController ()
{
CALayer *sublayer2,*sublayer3;
}
@end
@nicolastinkl
nicolastinkl / gist:12b02dd4b9db77320e70
Created December 25, 2015 01:54
iOS、Mac os Open Sources
Swift 语言指南
===
这份指南汇集了 Swift 语言主流学习资源,并以开发者的视角整理编排。
GitHub:[ipader/SwiftGuide](https://github.com/ipader/SwiftGuide) | 网站:[http://dev.swiftguide.cn](http://dev.swiftguide.cn) | _欢迎开发者一起[维护](https://github.com/ipader/SwiftGuide/pulls),或[反馈/投稿](https://github.com/ipader/SwiftGuide/issues/new)_
> 想了解关于该指南及 Swift 更多信息的同学,可以阅读短文《[致 Swift 开发者](https://github.com/ipader/SwiftGuide/blob/master/2014%20letter.md)》。 想快速找到优秀开源项目的开发者,可以访问我们额外整理的[《Swift 开源项目精选》](https://github.com/ipader/SwiftGuide/blob/master/Featured.md)。希望快速找到其中精选文章,可以访问[《Swift 文章精选》](https://github.com/ipader/SwiftGuide/blob/master/Featured-Articles.md)。
<span style="color:lightgray;font-size:12px">[@SwiftLanguage](http://weibo.com/swiftlanguage) 更新于 2015-4-26,更新内容详见[《2015-4-26 收录周报》](https://github.com/ipader/SwiftGuide/blob/master/weekly/2015-04-26.md)</span>
@nicolastinkl
nicolastinkl / gist:bcd2717a483874780da2
Created November 13, 2015 06:52
Create ovalInRect Curt round Red to draw
public extension CGFloat {
public func toRadians() -> CGFloat {
return (self * CGFloat(M_PI)) / 180.0
}
public func toDegrees() -> CGFloat {
return self * 180.0 / CGFloat(M_PI)
}
@nicolastinkl
nicolastinkl / github.
Created April 11, 2015 23:33
github定期执行脚本
shshjjsj
@nicolastinkl
nicolastinkl / shell.md
Created January 28, 2015 00:46
shell 30min study

Shell脚本编程30分钟入门

什么是Shell脚本

示例

看个例子吧:

#!/bin/sh
cd ~
mkdir shell_tut
cd shell_tut