Skip to content

Instantly share code, notes, and snippets.

@neverunlucky
neverunlucky / idsl-filter.sh
Last active February 4, 2021 16:42
idevicesyslog target filter shell script
#!/bin/bash
#name: idevicesyslog target filter shell script
#author: SerKo <https://github.com/serkoape>
#usage: idevicesyslog | ./idsl-filter.sh "<target name>"
#idevicesyslog | ./idsl-filter.sh "SpringBoard"
#idevicesyslog | ./idsl-filter.sh "SpringBoard(Custom.dylib)"
#idevicesyslog | sudo sh ./idsl-filter.sh "SpringBoard(Custom.dylib)"
@neverunlucky
neverunlucky / LineBreakString.m
Last active September 5, 2018 09:19
Obj-C Line Break String
#define __line_break_string__(s) #s
NSString *str = @__line_break_string__(
foo
bar
hello\nworld
);
#undef __line_break_string__
/*
foo bar hello
@neverunlucky
neverunlucky / NumberTest.m
Last active May 21, 2018 12:53
Objective-C NSNumber (__NSCFNumber vs __NSCFBoolean)
BOOL foo = YES;
id a = @(foo);
//className: __NSCFBoolean
id b = @(YES);
//className: __NSCFBoolean
id c = foo ? @(YES) : @(NO);
//className: __NSCFBoolean
@neverunlucky
neverunlucky / Marco-NSString.h
Last active August 22, 2018 11:12
Objective-C marco define symbol to NSString
//Credit: https://stackoverflow.com/questions/1793882/how-to-make-a-macro-that-can-take-a-string
#define STRINGIFY2(x) #x
#define STRINGIFY(x) STRINGIFY2(x)
#define PASTE2(a, b) a##b
#define PASTE(a, b) PASTE2(a, b)
#define PRINTTHIS(text) \
NSLog(PASTE(@, STRINGIFY(text)));
//Result