Skip to content

Instantly share code, notes, and snippets.

View karosLi's full-sized avatar
🎯
Focusing

Karosli karosLi

🎯
Focusing
View GitHub Profile
@novemberfiveco-gists
novemberfiveco-gists / WKCookieWebView.swift
Last active June 26, 2023 10:02
A WKWebView subclass that passes cookies after a 302 redirect response.
//
// WKCookieWebView.swift
//
// Created by Jens Reynders on 30/03/2018.
// Copyright (c) 2018 November Five
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@Skifary
Skifary / main.m
Last active October 11, 2019 08:35
替换所有block的实现
//
// main.m
// TestObjc
//
// Created by Skifary on 14/03/2018.
// Copyright © 2018 skifary. All rights reserved.
//
#import <Foundation/Foundation.h>
@Skifary
Skifary / main.m
Last active October 22, 2020 13:50
修改block的实现,先打印参数,再输出原有实现
#import <Foundation/Foundation.h>
#import "ffi.h"
NSMutableArray *g_allocations;
ffi_cif g_cif;
ffi_closure *g_closure;
void *g_replacement_invoke;
void *g_origin_invoke;
@Skifary
Skifary / main.m
Last active July 3, 2020 05:16
替换block原有实现
#import <Foundation/Foundation.h>
typedef struct __block_impl {
void *isa;
int Flags;
int Reserved;
void *FuncPtr;
}__block_impl;
typedef void(^GlobalBlock)(void);
@implementation AppHostCookie
+ (NSMutableArray<NSString *> *)cookieJavaScriptArray
{
NSMutableArray<NSString *> *cookieStrings = [[NSMutableArray alloc] init];
//取出cookie
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
@kientux
kientux / frameworks_blogpost_merge_script.sh
Last active July 27, 2023 17:17 — forked from brett-stover-hs/frameworks_blogpost_merge_script.sh
Merge simulator and device dynamic frameworks into one
# Merge Script
# 1
# Set bash script to exit immediately if any commands fail.
set -e
# 2
# Setup some constants for use later on.
FRAMEWORK_NAME="${PROJECT_NAME}"
@skratchdot
skratchdot / arrayBufferToString.js
Created March 3, 2016 04:43
Array Buffer -> String and String -> ArrayBuffer conversions in javascript
// source: http://stackoverflow.com/a/11058858
function ab2str(buf) {
return String.fromCharCode.apply(null, new Uint16Array(buf));
}
@hilen
hilen / FLAnimatedImageView+SDWebImage.swift
Last active December 4, 2018 18:37
FLAnimatedImageView with SDWebImage
```
import Foundation
import FLAnimatedImage
import SDWebImage
import Kingfisher
/*
Add this repo(https://github.com/rs/SDWebImage) to your project
*/
extension FLAnimatedImageView {
@sh1n0b1
sh1n0b1 / BinaryCookieReader.py
Created August 28, 2015 20:46
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. #
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule