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
// DySlim is complicated and requires writing 6GB to disk (if only temporarily). | |
// This lets you mount the dyld shared cache via FUSE; the resulting files are weird but readable by things like otool and strings. | |
// | |
// gcc -std=gnu99 -I/opt/local/include -L/opt/local/lib -D_FILE_OFFSET_BITS=64 -o dsc dsc.c -lfuse -framework CoreFoundation | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <stdio.h> |
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 | |
# Script for managing build and version numbers using git and agvtool. | |
# Change log: | |
# v1.0 18-Jul-11 First public release. | |
# v1.1 29-Sep-12 Launch git, agvtool via xcrun. | |
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
/* ---------------------------------------------------------- */ | |
/* */ | |
/* A media query that captures: */ | |
/* */ | |
/* - Retina iOS devices */ | |
/* - Retina Macs running Safari */ | |
/* - High DPI Windows PCs running IE 8 and above */ | |
/* - Low DPI Windows PCs running IE, zoomed in */ | |
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */ | |
/* - Android hdpi devices and above */ |
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
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) ) |
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/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
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
// iOS ロックスクリーン Notification | |
#define NotifName_LockComplete @"com.apple.springboard.lockcomplete" | |
#define NotifName_LockState @"com.apple.springboard.lockstate" | |
//call back | |
static void lockStatusChanged(CFNotificationCenterRef center, void *observer, CFStringRef name_cf, const void *object, CFDictionaryRef userInfo){ | |
NSString *name = (__bridge NSString*)name_cf; | |
if ([name isEqualToString:NotifName_LockComplete]) { |
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
// NSManagedObjectContext+DebugSwizzling.h | |
#import <CoreData/CoreData.h> | |
#if DEBUG | |
/** | |
* Toggles debugging of Core Data managed object contexts. | |
* | |
* When enabled, will fire NSLogs in the following cases: |
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
// iOS 9 allows you to animate between visual effects, which gives you the | |
// ability to manipulate the blur radius. this can be useful for animating | |
// a backdrop for a custom modal, and with a few tricks, can even be set | |
// indirectly, allowing you to "scrub" between them back and forth with | |
// a gesture, just like when you pull down Spotlight. | |
// these are the two effects you want to transition between | |
UIVisualEffect *startEffect = nil; // "nil" means no blur/tint/vibrancy (plain, fully-transparent view) | |
UIVisualEffect *endEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; |
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 Dispatch | |
/// Dispatch options for `forEach` loops | |
public enum ForEachClosureDispatch { | |
case sequential | |
case concurrent | |
} | |
extension Sequence { | |
/// Calls the given closure on each element in the sequence in the same order |
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 | |
@dynamicMemberLookup | |
enum JSON: Codable, CustomStringConvertible { | |
var description: String { | |
switch self { | |
case .string(let string): return "\"\(string)\"" | |
case .number(let double): | |
if let int = Int(exactly: double) { | |
return "\(int)" |
OlderNewer