Skip to content

Instantly share code, notes, and snippets.

View davidrinnan's full-sized avatar

David Rinnan davidrinnan

  • Rinnan Enterprises AB
  • Stockholm, Sweden
View GitHub Profile
@dews
dews / Limit mac bandwidth.md
Last active February 27, 2024 13:16
Limit mac bandwidth

Mac limit bandwidth

Enable firewall

Apple menu -> System Preferences -> Security & Privacy -> Firewall

sudo pfctl -e

Example

sudo dnctl pipe 1 config bw 10Kbit/s

@KentarouKanno
KentarouKanno / WKWebView.md
Last active March 30, 2023 17:24
WKWebView

WKWebView

import UIKit
import WebKit

class ViewController: UIViewController, WKNavigationDelegate {
    
    var wkWebView: WKWebView!
    let observerKeyName = ["estimatedProgress", "loading", "title", "URL", "hasOnlySecureContent", "canGoBack", "canGoForward"]
@katychuang
katychuang / remove_brew-mongo_osx.sh
Last active January 30, 2024 12:20
remove mongodb that was installed via brew
#!/usr/bin/env sh
# first check to see if mongo service is running. you can't delete any files until the service stops so perform a quick check.
launchctl list | grep mongo
# NOTE: the pipe | symbol means the commands on the right performs on the output from the left
# grep is a string search utility. `grep mongo` means search for the substring mongo
# use the unload command to end the mongo service. this is required to 'unlock' before removing the service.
# first look for the file to delete
MONGO_SERVICE_FILE=$(ls ~/Library/LaunchAgents/*mongodb*)