Skip to content

Instantly share code, notes, and snippets.

@yarshure
yarshure / NSObject+SPInvocationGrabbing.h
Created January 12, 2012 09:03 — forked from nevyn/NSObject+SPInvocationGrabbing.h
Spotify's invocation grabber, with some magic tricks
#import <Foundation/Foundation.h>
@interface SPInvocationGrabber : NSObject {
id _object;
NSInvocation *_invocation;
int frameCount;
char **frameStrings;
BOOL backgroundAfterForward;
BOOL onMainAfterForward;
BOOL waitUntilDone;
@yarshure
yarshure / gist:515b833fa1ec3605d12f
Created July 1, 2014 08:01
iOS dns TXT record query
#include <dns_sd.h>
void DNSSD_API callback
(
DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *fullname,
uint16_t rrtype,
@yarshure
yarshure / gist:0943a357139cb5e37412
Created July 1, 2014 09:14
iOS dns PTR record query
#include <dns_sd.h>
#include <resolv.h>
void DNSSD_API callback
(
DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
DNSServiceErrorType errorCode,
const char *fullname,
uint16_t rrtype,
@yarshure
yarshure / subtitle_wwdc15
Created June 26, 2015 15:23
wwdc15 videos subtitle
curl -O http://devstreaming.apple.com/videos/wwdc/2015/216isrjt4ku9w4/216/subtitles/eng/216_sd_layout_and_animation_techniques_for_watchkit.vtt
curl -O http://devstreaming.apple.com/videos/wwdc/2015/304ywrr62d/304/subtitles/eng/304_sd_itunes_connect_development_to_distribution.vtt
curl -O http://devstreaming.apple.com/videos/wwdc/2015/103ot7lzkdri2fvn1iyh/103/subtitles/eng/103_sd_apple_design_awards.vtt
curl -O http://devstreaming.apple.com/videos/wwdc/2015/105ncyldc6ofunvsgtan/105/subtitles/eng/105_sd_introducing_watchkit_for_watchos_2.vtt
curl -O http://devstreaming.apple.com/videos/wwdc/2015/201pps6n6g0nsnz/201/subtitles/eng/201_sd_ios_accessibility.vtt
curl -O http://devstreaming.apple.com/videos/wwdc/2015/1086gvs7f4vryixs49s6/108/subtitles/eng/108_sd_building_watch_apps.vtt
curl -O http://devstreaming.apple.com/videos/wwdc/2015/301tcfp66f/301/subtitles/eng/301_sd_whats_new_in_managing_apple_devices.vtt
curl -O http://devstreaming.apple.com/videos/wwdc/2015/6053hq2fz0ebo0lm/605/subtitles/eng/605_sd_going_
@yarshure
yarshure / 北京iOS开发
Created July 1, 2015 16:18
老孔是坏人
您好:
我是猎头ABC(MP:18721066158 QQ:12345) 专注于互联网,目前我在寻访ios开发方向人选,很高兴能和您合作,大公司和创业公司都有~方向有互联网、电商、互联网金融~职位主要以干活为主~详细JD在下面,您可以回复一份您的简历给我,方便我给到您合适的职位~
Tango 白石桥南 ios客户端开发工程师、ios技术经理
今日头条 知春路站 ios(高级)开发工程师、ios技术经理
宜信大数据 大望路 ios开发工程师
Hulu 清华科技园 software Developer - Device/Mobile
口袋购物 酒仙桥 ios高级工程师
火球网 国贸 ios开发工程师
@yarshure
yarshure / mylog.swift
Created October 21, 2015 16:04
log style
extension String : CollectionType {}
func myLog<T>(object: T, _ file: String = __FILE__, _ function: String = __FUNCTION__, _ line: Int = __LINE__) {
let fn = file.split { $0 == "/" }.last
if let f = fn {
let info = "\(f).\(function)[\(line)]:\(object)"
NSLog(info)
}
}
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <stdlib.h>
int main(int argv, char *argc[])
Please Note: After installation, the Kernel Debug Kit will be available at:
/Library/Developer/KDKs/
———————————————————————————————
The kernel file location has changed.
The kernel file location has moved to /System/Library/Kernels/kernel
enum Either<T1, T2> {
case Left(T1)
case Right(T2)
}
public class MyClas {
func mytest<T:CustomStringConvertible>(a:T) ->String{
return "\(a)"
}
func test(list:[String]) ->String{
return "abcd"