Skip to content

Instantly share code, notes, and snippets.

@dschneider
dschneider / gist:294256e447cd52c7855ad374b9cef0fa
Created April 14, 2023 09:46 — forked from rentzsch/gist:1047967
Close a Chrome Tab using AppleScript
tell application "Google Chrome"
set windowList to every tab of every window whose URL starts with "https://mail.google.com"
repeat with tabList in windowList
set tabList to tabList as any
repeat with tabItr in tabList
set tabItr to tabItr as any
delete tabItr
end repeat
end repeat
end tell
@dschneider
dschneider / debug.clj
Last active August 29, 2015 14:18 — forked from vsmart/gist:8deecda2be8fb3e6afa0
Debug clojure cool
;; This is a useful macro for clojure debugging
(defmacro dbg[x] `(let [x# ~x] (println "dbg:" '~x "=" x#) x#))
;; Use it anywhere in your expression like so:
(defn factorial[n] (if (= n 0) 1 (* n (dbg (factorial (dec n))))))
;; Taken from [stackoverflow](http://stackoverflow.com/a/2352280/789070)
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#