Skip to content

Instantly share code, notes, and snippets.

Antonin Hildebrand darwin

Block or report user

Report or block darwin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View btcd-debug-log-after-some-time.txt
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
View _compile.sh
#!/usr/bin/env bash
clj -Srepro -m cljs.main -co @compiler-opts.edn -c repro
@darwin
darwin / README.md
Last active Nov 28, 2018
Repro for CLJS-2993
View README.md

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 Oct 28, 2018
My quick stab at state monads in Clojure
View state_monad.clj
(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 Oct 10, 2018
clojure -Srepro -Sdeps '{:deps {issue {:git/url "https://gist.github.com/darwin/e7748419304915f75633666b906f23f8" :sha "af929e906525703509a4f86ba371d74f8338dc71"}}}' -m main
View deps.edn
{: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 Sep 29, 2018
[SOLVED] iMac sleep/wake issues caused by my USB mouse (Wake reason: XHC1)
View 00-readme.md

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 Oct 25, 2018
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
View terminal.sh
sudo tccutil reset AppleEvents
osascript -e "tell application \"Finder\" to «event BATFinit»"
View reset.applescript
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 Jun 12, 2018
`git clone https://github.com/binaryage/cljs-devtools && cd cljs-devtools && lein pprint`
View project.clj.edn
{: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 Mar 20, 2018
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.
View remove-finder-plist.sh
osascript -e "tell application \"Finder\" to quit"
mv ~/Library/Preferences/com.apple.finder.plist /tmp
osascript -e "tell application \"Finder\" to launch"
You can’t perform that action at this time.