Skip to content

Instantly share code, notes, and snippets.

btcd | 2019-09-26 20:28:19.074 [DBG] CHAN: Added time sample of 0s (total: 175)
btcd | 2019-09-26 20:28:19.074 [DBG] CHAN: New time offset: 0s
btcd | 2019-09-26 20:28:19.508 [DBG] PEER: Cannot start peer <IP>:21611 (inbound): protocol negotiation timeout
btcd | 2019-09-26 20:28:24.671 [DBG] PEER: Cannot start peer <IP>:36080 (inbound): protocol negotiation timeout
btcd | 2019-09-26 20:28:38.217 [DBG] PEER: Sending ping to <IP>:8333 (outbound)
btcd | 2019-09-26 20:28:38.258 [DBG] PEER: Sending ping to <IP>:8333 (outbound)
btcd | 2019-09-26 20:28:38.290 [DBG] PEER: Sending ping to <IP>:8333 (outbound)
btcd | 2019-09-26 20:28:38.621 [DBG] PEER: Cannot start peer <IP>:14449 (inbound): protocol negotiation timeout
btcd | 2019-09-26 20:28:40.638 [DBG] PEER: Cannot start peer <IP>:64427 (inbound): protocol negotiation timeout
btcd | 2019-09-26 20:28:41.857 [DBG] PEER: Cannot start peer <IP>:36622 (inbound): protocol negotiation timeout
@darwin
darwin / _compile.sh
Last active January 26, 2019 15:44
fat cond
#!/usr/bin/env bash
clj -Srepro -m cljs.main -co @compiler-opts.edn -c repro
@darwin
darwin / README.md
Last active November 28, 2018 14:16
Repro for CLJS-2993

See https://dev.clojure.org/jira/browse/CLJS-2993

clj -Srepro -Sdeps '{:deps {github-darwin/gist-2298be76f15a2be3f0ffe3252c3afcb8 {:git/url "https://gist.github.com/darwin/2298be76f15a2be3f0ffe3252c3afcb8" :sha "e654a965e69ae1c51abb07a1c1a7c165759357f2"} org.clojure/clojurescript {:git/url "https://github.com/clojure/clojurescript" :sha "6cbd40f865132b8b13c6b902b715aed43e64f0b1"}}}' -m cljs.main -co @compiler-opts.edn -co '{:output-dir "out-bad"}' -c repro
clj -Srepro -Sdeps '{:deps {github-darwin/gist-2298be76f15a2be3f0ffe3252c3afcb8 {:git/url "https://gist.github.com/darwin/2298be76f15a2be3f0ffe3252c3afcb8" :sha "e654a965e69ae1c51abb07a1c1a7c165759357f2"} org.clojure/clojurescript {:git/url "https://github.com/clojure/clojurescript" :sha "b5e8dbd3316b0119ec3b80a73511127e678ce482"}}}' -m cljs.main -co @compiler-opts.edn -co '{:output-dir "out-good"}' -c repro
@darwin
darwin / state_monad.clj
Created October 28, 2018 15:35
My quick stab at state monads in Clojure
(ns experimental.state-monad
(:refer-clojure :exclude [let]))
; This is a poor man's attempt to get something like state monad.
; We could have used clojure.algo.monads, but I wanted to avoid these drawbacks:
; https://www.reddit.com/r/Clojure/comments/8pyxk8/motivation_for_monads/e0gb6on/
; Alternatively we could have used some heavy category theory library like cats or fluokitten, but
; that looked like a pretty complex thing to learn and keep in head.
; Also I want this thing to play well with Cursive.
;
@darwin
darwin / deps.edn
Last active October 10, 2018 22:18
clojure -Srepro -Sdeps '{:deps {issue {:git/url "https://gist.github.com/darwin/e7748419304915f75633666b906f23f8" :sha "af929e906525703509a4f86ba371d74f8338dc71"}}}' -m main
{:paths ["."]
:deps {metosin/spec-tools {:mvn/version "0.7.2"}
org.clojure/test.check {:mvn/version "0.9.0"}
org.clojure/clojure {:mvn/version "1.9.0"}}}
@darwin
darwin / 00-readme.md
Last active June 18, 2020 05:21
[SOLVED] iMac sleep/wake issues caused by my USB mouse (Wake reason: XHC1)

Wake reason: XHC1

Since macOS High Sierra (maybe even Sierra) I started having trouble putting my iMac (mid 2015) to sleep. After installing clean Mojave system the problem didn't go away, even after jumping through various hoops and trying to disable every software which might be causing it.

The problem

After entering sleep mode the computer did DarkWake unexpectedly. Usually within one minute after sleeping. This was especially annoying because my external drives would spin up at that point.

The solution

@darwin
darwin / terminal.sh
Last active April 25, 2020 09:10
How to inject TotalFinder via a Terminal command under macOS 10.14 Mojave (B6). First install latest TotalFinder beta from https://totalfinder.binaryage.com/beta-changes#latest
sudo tccutil reset AppleEvents
osascript -e "tell application \"Finder\" to «event BATFinit»"
tell application "System Preferences"
launch
activate
reveal anchor "Privacy_Assistive" of pane id "com.apple.preference.security"
display alert "RESET ACCESSIBILITY APPROVAL LIST" message "This script will reset (clear) the list of applications in the Accessibility section of the Privacy system preference pane." & linefeed & linefeed & "This action requires an administrative password, and cannot be undone." as critical buttons {"Cancel", "Reset"} cancel button "Cancel"
set show all to true
@darwin
darwin / project.clj.edn
Last active June 12, 2018 19:16
`git clone https://github.com/binaryage/cljs-devtools && cd cljs-devtools && lein pprint`
{:description
"A collection of Chrome DevTools enhancements for ClojureScript developers.",
:compile-path "/Users/darwin/code/cljs-devtools/target/classes",
:deploy-repositories
(["clojars"
{:url "https://clojars.org/repo/",
:password :gpg,
:username :gpg,
:creds :gpg}]),
:group "binaryage",
@darwin
darwin / remove-finder-plist.sh
Last active March 20, 2018 16:06
This script quits Finder, moves it's plist to `/tmp/com.apple.finder.plist` and then launches Finder again. This should effectively reset Finder into factory defaults. Please open `/Applications/Utilities/Terminal.app` and execute this line-by-line.
osascript -e "tell application \"Finder\" to quit"
mv ~/Library/Preferences/com.apple.finder.plist /tmp
osascript -e "tell application \"Finder\" to launch"