Skip to content

Instantly share code, notes, and snippets.

@wassupdoc
wassupdoc / WithPopover.swift
Last active February 20, 2024 08:48 — forked from ccwasden/WithPopover.swift
Custom size popover in iOS SwiftUI
// -- Usage
struct Content: View {
@State var open = false
@State var popoverSize = CGSize(width: 300, height: 300)
var body: some View {
WithPopover(
showPopover: $open,
popoverSize: popoverSize,
@wassupdoc
wassupdoc / popoversample
Last active May 7, 2021 04:45
SwiftUI Popover
class PopupViewController:UIViewController{
let frame:CGRect
let content:AnyView
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
@wassupdoc
wassupdoc / gist:f57e65d2a5f52101a5ec6f65355e85c2
Last active November 25, 2020 10:58
Freenas iocage Resilio install
# make temp file that will cause iocage to install some packages
echo '{"pkgs":["ca_root_nss"]}' > /tmp/pkg.json
# create jail
iocage create -n "rslsync" -p /tmp/pkg.json -r 11.3-RELEASE ip4_addr="vnet0|YOURRESILIOIP/24" defaultrouter="ROUTERIP" vnet="on" allow_raw_sockets="1" boot="on"
# remove the temp file
rm /tmp/pkg.json
#make our iocage directories
iocage exec rslsync mkdir -p /config
iocage exec rslsync mkdir -p /mnt/syncdata
all-ping enable
broadcast-ping disable
ipv6-name allow-all-6 {
default-action accept
rule 1 {
action accept
state {
established enable
related enable
}
configure
set serivce gui https-port 8443
commit
save
#make sure to open the port in our lan-local config.
configure
edit firewall
edit name lan-local
@wassupdoc
wassupdoc / zone_instructions
Last active July 10, 2024 03:41
Zone settings for edgerouter
#based on http://www.forshee.me/2016/03/02/ubiquiti-edgerouter-lite-setup-part-2-firewall-setup.html
configure
edit firewall name allow-est-drop-inv
set default-action drop
set enable-default-log
set rule 1 action accept
set rule 1 state established enable
set rule 1 state related enable
set rule 2 action drop