Skip to content

Instantly share code, notes, and snippets.

View pupboss's full-sized avatar

Jie Li pupboss

View GitHub Profile
@pupboss
pupboss / main.cpp
Created May 21, 2015 16:30
Block-Test
This file has been truncated, but you can view the full file.
#ifndef __OBJC2__
#define __OBJC2__
#endif
struct objc_selector; struct objc_class;
struct __rw_objc_super {
struct objc_object *object;
struct objc_object *superClass;
__rw_objc_super(struct objc_object *o, struct objc_object *s) : object(o), superClass(s) {}
};
#ifndef _REWRITER_typedef_Protocol
@pupboss
pupboss / afn-custom-header.m
Created April 13, 2015 11:55
AFN 框架 自定义请求头
// 1.创建请求管理对象
AFHTTPRequestOperationManager *mgr = [AFHTTPRequestOperationManager manager];
[mgr.requestSerializer setValue:@"6defcbc5-69cf-4d4b-9345-00ad9fa97db4" forHTTPHeaderField:@"Authorization"];
[mgr GET:@"http://l*******/~self" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"%@",responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
}];
@pupboss
pupboss / DeviceExtension.swift
Last active August 29, 2015 14:18
get device model swift
// MARK: UIDeveice 扩展
let deviceList = [
"iPhone1,1": "iPhone 2G (A1203)",
"iPhone1,2": "iPhone 3G (A1241/A1324)",
"iPhone2,1": "iPhone 3GS (A1303/A1325)",
"iPhone3,1": "iPhone 4 (A1332)",
"iPhone3,2": "iPhone 4 (A1332)",
"iPhone3,3": "iPhone 4 (A1349)",
"iPhone4,1": "iPhone 4S (A1387/A1431)",