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 / rule.json
Last active December 11, 2023 02:42
本人在用的规则,其他人可以根据自己的情况修改
{
"zhuanlan.zhihu.com": [
{
"type": "autoClick",
"data": ".Modal-closeButton"
}
],
"blog.csdn.net": [
{
"type": "autoHide",
@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 / decodeURI VS. decodeURIComponent.js
Created April 11, 2011 07:10
decodeURI() VS. decodeURIComponent()
var origin = "&callback=%3Chead%3E%3Cscript%3Ewindow.onload%3Dfunction()%7Bvar%20mailhost%3Dlocation.search.match(%2Fmailhost%3D.%2B(com%7Cnet)%26maildomain%2F)%5B0%5D.split('%3D')%5B1%5D.replace('%26maildomain'%2C'')%3Blocation.href%3D'http%3A%2F%2F'%2Bmailhost%2B'%2Fjy3%2Foptions%2Fforaddrclone.jsp'%2Blocation.search%2B'%26code%3D'%2Bdocument.body.innerHTML%3B%7D%3C%2Fscript%3E%3Chead%3E&rnd=";
//A. decodeURI(origin) = ---------------------------------------------------
var result1 = "&callback=<head><script>window.onload%3Dfunction(){var mailhost%3Dlocation.search.match(%2Fmailhost%3D.%2B(com|net)%26maildomain%2F)[0].split('%3D')[1].replace('%26maildomain'%2C'')%3Blocation.href%3D'http%3A%2F%2F'%2Bmailhost%2B'%2Fjy3%2Foptions%2Fforaddrclone.jsp'%2Blocation.search%2B'%26code%3D'%2Bdocument.body.innerHTML%3B}<%2Fscript><head>&rnd=";
//B. decodeURIComponent(origin) = ---------------------------------------------------
var result2 = "&callback=<head><script>window.onload=function(){var mailhost=location.s
@implementation AppHostCookie
+ (NSMutableArray<NSString *> *)cookieJavaScriptArray
{
NSMutableArray<NSString *> *cookieStrings = [[NSMutableArray alloc] init];
//取出cookie
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
@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 / compressImage.sh
Last active March 8, 2019 06:42
compress images in some directory using tinypng service 使用 tinypng 来压缩图片
#!/bin/bash
# author: wang_liang@corp.netease.com
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 / 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.
//
@hite
hite / gist:175b54f7fa77c124583ed997f3675894
Created March 22, 2017 02:44
Linux系统基础知识
1.在Linux系统中,以 文件 方式访问设备 。
  2. Linux内核引导时,从文件 /etc/fstab 中读取要加载的文件系统。
  3. Linux文件系统中每个文件用 inode 来标识。
  4. 全部磁盘块由四个部分组成,分别为引导块 、专用块 、 inode表块 和数据存储块。
  5. 链接分为: 硬链接 和 符号链接 。
  6. 超级块包含了inode表 和 空闲块表 等重要的文件系统信息。
  7. 某文件的权限为:drw-r--r--,用数值形式表示该权限,则该八进制数为: 644 ,该文件属性是 目录 。
  8. 前台起动的进程使用 Ctrl+c 终止。
  9. 静态路由设定后,若网络拓扑结构发生变化,需由系统管理员修改路由的设置。
  10. 网络管理的重要任务是: 控制 和 监控 。
@hite
hite / gist:a23063f65c2e7c6d96016e57dd5ee24b
Created March 22, 2017 02:44
Linux系统基础知识
1.在Linux系统中,以 文件 方式访问设备 。
  2. Linux内核引导时,从文件 /etc/fstab 中读取要加载的文件系统。
  3. Linux文件系统中每个文件用 inode 来标识。
  4. 全部磁盘块由四个部分组成,分别为引导块 、专用块 、 inode表块 和数据存储块。
  5. 链接分为: 硬链接 和 符号链接 。
  6. 超级块包含了inode表 和 空闲块表 等重要的文件系统信息。
  7. 某文件的权限为:drw-r--r--,用数值形式表示该权限,则该八进制数为: 644 ,该文件属性是 目录 。
  8. 前台起动的进程使用 Ctrl+c 终止。
  9. 静态路由设定后,若网络拓扑结构发生变化,需由系统管理员修改路由的设置。
  10. 网络管理的重要任务是: 控制 和 监控 。
@hite
hite / round.m
Created May 20, 2016 05:21 — forked from larsacus/round.m
Round corner without clipsToBounds
// Clips the bottom left corner to a radius
CGSize cornerSize = CGSizeMake(10,10);
UIBezierPath *roundRectMaskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds
byRoundingCorners:UIRectCornerBottomLeft
cornerRadii:cornerSize];
CAShapeLayer *roundRectMaskLayer = [CAShapeLayer layer];
roundRectMaskLayer.frame = self.view.bounds;
roundRectMaskLayer.path = roundRectMaskPath.CGPath;