This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen | |
{% set prefix %}UI{% endset %} | |
{% set controller %}ViewController{% endset %} | |
import Foundation | |
import UIKit | |
{% macro className scene %}{% filter removeNewlines %} | |
{% if scene.customClass %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in interface: | |
@property(nonatomic) CFRunLoopObserverRef runloopObserver; | |
in init: | |
self.runloopObserver = CFRunLoopObserverCreate(NULL, kCFRunLoopAllActivities, true, 0, &runloopCallback, NULL); | |
CFRunLoopAddObserver(CFRunLoopGetMain(), self.runloopObserver, kCFRunLoopCommonModes); | |
CFRunLoopRemoveObserver(CFRunLoopGetMain(), self.runloopObserver, kCFRunLoopCommonModes); | |
void runloopCallback(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) { | |
NSLog(@"runloop %lu", activity); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void printRole() { | |
task_category_policy_data_t category_policy; | |
mach_msg_type_number_t task_info_count = TASK_CATEGORY_POLICY_COUNT; | |
boolean_t get_default = FALSE; | |
kern_return_t result = | |
task_policy_get(mach_task_self(), TASK_CATEGORY_POLICY, | |
&category_policy, | |
&task_info_count, &get_default); | |
if(result != KERN_SUCCESS) { | |
NSLog(@"damn"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lldb | |
import commands | |
import optparse | |
import shlex | |
def create_continue_when_recursion_depth_not_equal_to_options(): | |
usage = "usage: %prog <depth as stop-condition>" | |
description='''Struggling with debugging a recursive function? You've set a breakpoint that should only | |
break on a certain recursion-depth? This command is meant to rescue. Set it as action to a breakpoint | |
with the depth you want the breakpoint to stop as argument, like |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export __CF_USER_TEXT_ENCODING=0x1F5:0x8000100:0x8000100; cat "$@" | pbcopy |