Skip to content

Instantly share code, notes, and snippets.

View bdashore3's full-sized avatar
😎
Reinventing the wheel since 2018

Brian Dashore bdashore3

😎
Reinventing the wheel since 2018
View GitHub Profile
@maakcode
maakcode / NSBlur.swift
Created May 11, 2020 03:30
Visual Effects View in SwiftUI, AppKit
// Visual Effects View in SwiftUI, AppKit
// cf. https://gist.github.com/edwurtle/98c33bc783eb4761c114fcdcaac8ac71#file-blur-swift
import SwiftUI
struct NSBlur: NSViewRepresentable {
var blendingMode: NSVisualEffectView.BlendingMode = .withinWindow
func makeNSView(context: Context) -> NSVisualEffectView {
let view = NSVisualEffectView()
view.blendingMode = blendingMode
@insidegui
insidegui / WebCacheCleaner.swift
Created September 14, 2016 23:12
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