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
- (NSArray *) runningProcesses { | |
//CTL_KERN,KERN_PROC,KERN_PROC_ALL | |
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL ,0}; | |
size_t miblen = 4; | |
size_t size; | |
int st = sysctl(mib, miblen, NULL, &size, NULL, 0); | |
struct kinfo_proc * process = NULL; | |
struct kinfo_proc * newprocess = NULL; |
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
#include <objc/runtime.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include "SwizzleMyNizzleProtocol.h" | |
void SwizzleMethod(Class _class, SEL sel, IMP imp, const char *prefix) { | |
if (_class == nil) |
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
/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage |
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
extern uint32_t dyld_get_program_sdk_version() WEAK_IMPORT_ATTRIBUTE; | |
extern BOOL DZApplicationUsesLegacyUI(void) | |
{ | |
static dispatch_once_t onceToken; | |
static BOOL legacyUI = NO; | |
dispatch_once(&onceToken, ^{ | |
uint32_t sdk = __IPHONE_OS_VERSION_MIN_REQUIRED; | |
if (dyld_get_program_sdk_version != NULL) { | |
sdk = dyld_get_program_sdk_version(); |
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
// The purpose of this gist is to provide examples of many real life date computations | |
// This is uploaded as a gist so that it can be copy and pasted into either a OS X or | |
// iOS project. You can either take it all "[Cmd]+[A], [Cmd]+[C]" or just a small piece. | |
// The results are fairly well formattes as log output and I recommend that you run this | |
// code to see the actual results yourself. Change some of the values and see what happens. | |
#pragma mark - Setup | |
NSString *line = @"–––––––––––––––––––––––––––––––––––––––––––––––––––––––"; |
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
# Usage: | |
# cd to dir with xcode.pbxproj and execute. | |
ARCHIVE_PATH='output.ipa' | |
BAR='\"B:A:R\"' | |
xcodebuild -scheme "My Scheme" -configuration "Enterprise" GCC_PREPROCESSOR_DEFINITIONS='FOO='$BAR'' archive -archivePath $ARCHIVE_PATH || { echo Enterprise BUILD failed"; exit 1; } | |
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
# coding: utf-8 | |
from objc_util import * | |
NSAKDeserializer = ObjCClass('NSAKDeserializer') | |
NSAKDeserializerStream = ObjCClass('NSAKDeserializerStream') | |
NSAKSerializer = ObjCClass('NSAKSerializer') | |
NSAKSerializerStream = ObjCClass('NSAKSerializerStream') | |
NSAbstractLayoutGuide = ObjCClass('NSAbstractLayoutGuide') | |
NSAddressCheckingResult = ObjCClass('NSAddressCheckingResult') | |
NSAffineTransform = ObjCClass('NSAffineTransform') |
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
brew install gifsicle | |
brew install xquartz | |
brew install ffmpeg | |
gifType=".gif" | |
movType=".m4v" | |
timestring=`date +"%m_%d_%Y"` | |
capturePath=~/Desktop/ScreenRecording_$timestring | |
displayDialog () { |
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 Foundation | |
@objc(EnvConfig) | |
class EnvConfig: NSObject { | |
#if ENVConfigStaging | |
class var isProduction:Bool { | |
return false | |
} |
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
#! /bin/sh | |
booted_uuids=`xcrun simctl list devices | \ | |
grep "(Booted)" | \ | |
grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})"` | |
all_uuids=($(echo $booted_uuids | tr ";" "\n")) | |
last_uuid=${all_uuids[${#all_uuids[@]}-1]} | |
exit_cleanly() { |
OlderNewer