Skip to content

Instantly share code, notes, and snippets.

@dominicfreeston
dominicfreeston / browser-reloader-mac.clj
Last active May 12, 2022
Reload browser on file change (MacOS/AppleScript/babashka)
View browser-reloader-mac.clj
#!/usr/bin/env bb
(require '[babashka.pods :as pods])
(pods/load-pod 'org.babashka/fswatcher "0.0.3")
(require '[pod.babashka.fswatcher :as fw])
(def app (or (second *command-line-args*) "Safari"))
(println "will reload" app)
@dominicfreeston
dominicfreeston / browser-reloader-ubuntu.clj
Last active May 12, 2022
Reload browser on file-change (Ubuntu/xdotool/babashka)
View browser-reloader-ubuntu.clj
#!/usr/bin/env bb
(require '[babashka.pods :as pods])
(pods/load-pod 'org.babashka/fswatcher "0.0.3")
(require '[pod.babashka.fswatcher :as fw])
(println "select window to reload")
;; This will block the script until the user has selected a window
(def browser-window (:out (shell/sh "xdotool" "selectwindow")))
@dominicfreeston
dominicfreeston / AppearanceContainer.swift
Last active Aug 23, 2021
SwiftUI Transparent List Wrapper - Works in iOS 14
View AppearanceContainer.swift
/// Wraps its content in a HostingViewController that has the backgroundColor of UITableView appearance
/// within it set to .clear, thus working around the issue where SwiftUI Lists always have white backgrounds,
/// without inadvertently affecting the appearance of all UITableViews in the app.
/// Setting the listRowBackground explicitly is still required, setting that to clear won't work.
struct ListAppearanceContainer<Content>: View, UIViewControllerRepresentable where Content: View {
let content: Content
class AppearanceContainerViewController<Content>: UIHostingController<Content> where Content: View {}
init(_ content: () -> Content) {
@dominicfreeston
dominicfreeston / org.jenkins-agent.plist
Last active Aug 29, 2015
Jenkins Slave LaunchAgent
View org.jenkins-agent.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>StandardOutPath</key>
<string>/Users/jenkins/jenkins-logs/jenkins-agent-out.log</string>
<key>StandardErrorPath</key>
<string>/Users/jenkins/jenkins-logs/jenkins-agent-out-err.log</string>
<key>KeepAlive</key>
<true/>
View keybase.md

Keybase proof

I hereby claim:

  • I am dominicfreeston on github.
  • I am dominicfreeston (https://keybase.io/dominicfreeston) on keybase.
  • I have a public key whose fingerprint is 4395 0568 2404 E509 5920 183A A600 5535 CC88 382B

To claim this, I am signing this object: