Skip to content

Instantly share code, notes, and snippets.

View samma835's full-sized avatar

samma samma835

  • Shanghai
View GitHub Profile
@samma835
samma835 / WebCacheCleaner.swift
Created June 26, 2019 05:46 — forked from insidegui/WebCacheCleaner.swift
Clear WKWebView's cookies and website data storage, very useful during development.
import Foundation
import WebKit
final class WebCacheCleaner {
class func clean() {
HTTPCookieStorage.shared.removeCookies(since: Date.distantPast)
print("[WebCacheCleaner] All cookies deleted")
WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in
@samma835
samma835 / stop_photos.sh
Created August 13, 2020 01:09
stop photos when connect iPhone
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES