Skip to content

Instantly share code, notes, and snippets.

View sskorokhodov's full-sized avatar

Simon Skorokhodov sskorokhodov

View GitHub Profile
@sskorokhodov
sskorokhodov / CloseAllNotifications.applescript
Last active February 19, 2019 12:17
Close all MacOS system notifications (not in Notification Center)
tell application "System Events"
tell process "NotificationCenter"
repeat while (count windows) > 1
set numwins to (count windows)
repeat with i from numwins to 1 by -1
click button "Close" of window i
end repeat
end repeat
end tell
end tell
@sskorokhodov
sskorokhodov / core.async.ext.clj
Created June 3, 2018 14:51
clojure.core.async extentions
(ns core.async.ext
(:require [clojure.core.async :as async :refer [<!! <! >! put! go go-loop]]
[clojure.core.async.impl.protocols :as ap]
[clojure.core.async.impl.dispatch :as dispatch])
(:import [java.util.concurrent.locks Lock]))
;; Channle uses buffer after acquiring channel's mutex only
(deftype TriggerBuffer [^:unsynchronized-mutable on?]
ap/UnblockingBuffer
ap/Buffer