Skip to content

Instantly share code, notes, and snippets.

View annidy's full-sized avatar
💭
I may be slow to respond.

fengxing annidy

💭
I may be slow to respond.
View GitHub Profile
@annidy
annidy / BinaryCookieReader.py
Created July 21, 2021 07:24 — forked from sh1n0b1/BinaryCookieReader.py
BinaryCookieReader
#*******************************************************************************#
# BinaryCookieReader: Written By Satishb3 (http://www.securitylearn.net) #
# #
# For any bug fixes contact me: satishb3@securitylearn.net #
# #
# Usage: Python BinaryCookieReader.py Cookie.Binarycookies-FilePath #
# #
# Safari browser and iOS applications store the persistent cookies in a binary #
# file names Cookies.binarycookies.BinaryCookieReader is used to dump all the #
# cookies from the binary Cookies.binarycookies file. #
#!/bin/bash
ssh -p 2222 root@localhost "/sbin/hfs_uti /dev/rdisk0s2s1 cat /.journal" > my.journal
ssh -p 2222 root@localhost "/sbin/hfs_uti /dev/rdisk0s1s2 cat /.journal" > my.journal
@annidy
annidy / 接码平台.md
Created February 7, 2021 09:07
接码平台
title date categories author tags
接码平台
2019-12-12
article
Kamchan
IOS
MacOS
@annidy
annidy / a.m
Last active December 18, 2020 08:11 — forked from michaeleisel/a.m
//Copyright (c) 2018 Michael Eisel. All rights reserved.
#import "CLRCallRecorder.h"
#import <dlfcn.h>
#import <libkern/OSAtomicQueue.h>
#import <pthread.h>
typedef struct {
void *ptr;
NSInteger number;
@annidy
annidy / AppDelegate.m
Created September 20, 2020 07:19
disalbe NSAssert
#import <objc/runtime.h>
@implementation NSAssertionHandler (Disable)
+ (void)initialize {
[self swizzMethod:@selector(handleFailureInMethod:object:file:lineNumber:description:) to:@selector(swizz_handleFailureInMethod:object:file:lineNumber:description:)];
[self swizzMethod:@selector(handleFailureInFunction:file:lineNumber:description:) to:@selector(swizz_handleFailureInFunction:file:lineNumber:description:)];
}
+ (void)swizzMethod:(SEL)originalSelector to:(SEL)swizzledSelector {
require 'xcodeproj'
project_path = Dir.glob("*.xcodeproj")[0]
project = Xcodeproj::Project.open(project_path)
project.targets.select {
|target| target.name.include? "InHouse"
}.each { |target|
puts "Process " + target.name + "..."
puts "Delete copy phases", target.copy_files_build_phases
target.copy_files_build_phases.each { |phases|
@annidy
annidy / libdispatch-efficiency-tips.md
Created February 27, 2020 01:37 — forked from tclementdev/libdispatch-efficiency-tips.md
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

I suspect most developers are using the libdispatch inefficiently due to the way it was presented to us at the time it was introduced and for many years after that, and due to the confusing documentation and API. I realized this after reading the 'concurrency' discussion on the swift-evolution mailing-list, in particular the messages from Pierre Habouzit (who is the libdispatch maintainer at Apple) are quite enlightening (and you can also find many tweets from him on the subject).

My take-aways are:

@annidy
annidy / textHeight.m
Created May 22, 2019 13:31 — forked from brennanMKE/textHeight.m
Text Height in Objective-C for NSString and NSAttributedString
- (CGFloat)heightForAttributedString:(NSAttributedString *)text maxWidth:(CGFloat)maxWidth {
if ([text isKindOfClass:[NSString class]] && !text.length) {
// no text means no height
return 0;
}
NSStringDrawingOptions options = NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading;
CGSize size = [text boundingRectWithSize:CGSizeMake(maxWidth, CGFLOAT_MAX) options:options context:nil].size;
@annidy
annidy / Python3 HTTP Server.py
Created December 4, 2018 07:02 — forked from Integralist/Python3 HTTP Server.py
Python3 HTTP Server.py
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
HOST_NAME = 'localhost'
PORT_NUMBER = 9000
class MyHandler(BaseHTTPRequestHandler):
def do_HEAD(self):
self.send_response(200)
@annidy
annidy / NSCalendar.m
Created August 15, 2013 03:47
NSCalendar示例
NSDate *date = [NSDate date];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *comps;
// 年月日获得
comps = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit)
fromDate:date];
NSInteger year = [comps year];
NSInteger month = [comps month];
NSInteger day = [comps day];