Skip to content

Instantly share code, notes, and snippets.

View 0x8badf00d's full-sized avatar

0x8badf00d 0x8badf00d

View GitHub Profile
@0x8badf00d
0x8badf00d / gist:3973770
Created October 29, 2012 14:13
UIAlertViewStylePlainTextInput
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Alert Message" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert textFieldAtIndex:0].borderStyle = UITextBorderStyleRoundedRect;
[alert show];
@0x8badf00d
0x8badf00d / CCamera.m
Created November 27, 2012 18:53
Really simple Objective-C AVFoundation Camera class
//
// CCamera.h
// CCamera
//
// Created by Jonathan Wight on 7/12/12.
// Copyright (c) 2012 Jonathan Wight. All rights reserved.
//
#import <Foundation/Foundation.h>
AFJSONRequestOperation *operationJSON = [AFJSONRequestOperation
JSONRequestOperationWithRequest:requestJSON
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSMutableArray *results = [JSON valueForKey:@"results"];
// UPDATED CODE
for (id obj in [results valueForKey:@"value"]) {
if (![items containsObject:obj]) {
[items addObject:obj];
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) )
#import "PLCrashReporterConfig.h"
#import "PLCrashReporter.h"
#import "PLCrashReport.h"
#import "PLCrashReportTextFormatter.h"
- (void)watchdog
{
NSTimeInterval pingInterval = 1.0/60.0;
NSTimeInterval watchdogInterval = 1.0/30.0;
@0x8badf00d
0x8badf00d / CrashManager
Created March 24, 2014 03:04
Generate live crash report using PLCrashReporter
@interface CrashManager:NSObject
/**
* Generates live crash report, without triggering an actual crash condition.
*
* Works only if the vendor SDK is built using PLCrashReporter v 1.1 atleast.
* We are using runtime magic to call generateLiveReportAndReturnError: method on PLCrashReporter instance without changing vendor sdk (QuincyKit, HockeyApp, others)
*/
- (void)generateLiveReport;
@end
@0x8badf00d
0x8badf00d / CodeTest.c
Created May 16, 2014 14:41
Write function if the input number is 2 return 1, if the input number is 1 then return 2
int usingSubtraction(int x)
{
return 3-x;
}
int usingDivision(int x)
{
return 2/x;
}
[
{
"itemId": "123456",
"definingAttributes": [
{
"attributeName": "Product Length (in.)",
"attributeValue": "10"
},
{
"attributeName": "Product Width (in.)",
@0x8badf00d
0x8badf00d / Jailbreak
Last active September 4, 2016 04:34
Inspect view hierarchy and Decrypt binaries
Decrypt Binaries from AppStore IPA
-----------------------------------
* `Cydia` - Add Source - http://cydia.iphonecake.com/
* `Mobile Terminal` - login root - Clutch - Clutch <appname>
* `/var/root/` - Location for Decrypted files
* `Class-dump` - `./class-dump -H <location-of-binary> -o <location-to-save-header-files>` To dump all headers
Inspect View-Hierarchy of Apps
------------------------------
* CyDelete - Install CyDelete from Cydia if MobileSubstrate folder is not listed in /Library/.
@0x8badf00d
0x8badf00d / gist:4e960e5d1e6b5aa08464
Created August 30, 2014 20:42
Mobile Conference Videos