Skip to content

Instantly share code, notes, and snippets.

View hite's full-sized avatar
🎯
Focusing

hite hite

🎯
Focusing
  • emohz.cn
  • HangZhou ,Zhejiang
View GitHub Profile
@hite
hite / cookieforwebview.m
Created June 7, 2018 02:31
WKWebview 设置cookie 的代码示例
//
// CICAppHostViewController.m
// myApp
//
// 需要h5和native 相互调用接口 页面使用此viewcontroller。
//
// Created by hite on 9/22/15.
// Copyright © 2015 netease. All rights reserved.
//
@implementation AppHostCookie
+ (NSMutableArray<NSString *> *)cookieJavaScriptArray
{
NSMutableArray<NSString *> *cookieStrings = [[NSMutableArray alloc] init];
//取出cookie
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
@hite
hite / PerformanceMonitor.m
Last active June 27, 2023 11:06
在 runloop 里捕获 主线程卡顿,并且收集到卡顿时堆栈的信息,供下一步 fabric 来处理
//
// PerformanceMonitor.m
// SuperApp
//
// Created by qianjianeng on 15/11/12.
// Copyright © 2015年 Tencent. All rights reserved.
//
#import "PerformanceMonitor.h"
#import <mach/mach.h>
@hite
hite / compressImage.sh
Last active March 8, 2019 06:42
compress images in some directory using tinypng service 使用 tinypng 来压缩图片
#!/bin/bash
# author: [email protected]
log_info() {
printf "[\e[36m%s\e[0m] [\e[32mINFO\e[0m] $*\n\r" "$(date +'%H:%M:%S')"
}
log_warn() {
printf "[\e[36m%s\e[0m] [\e[33mWARNING\e[0m] $*\n\r" "$(date +'%H:%M:%S')"
}
@hite
hite / listAllEventListeners.js
Created June 15, 2019 17:15 — forked from tkafka/listAllEventListeners.js
List all event listeners in a document
console.table((function listAllEventListeners() {
const allElements = Array.prototype.slice.call(document.querySelectorAll('*'));
allElements.push(document); // we also want document events
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
let elements = [];
for (let i = 0; i < allElements.length; i++) {
@hite
hite / rule.json
Last active December 11, 2023 02:42
本人在用的规则,其他人可以根据自己的情况修改
{
"zhuanlan.zhihu.com": [
{
"type": "autoClick",
"data": ".Modal-closeButton"
}
],
"blog.csdn.net": [
{
"type": "autoHide",