Skip to content

Instantly share code, notes, and snippets.

keep calm and git push -f

Ning Sun sunng87

keep calm and git push -f
Block or report user

Report or block sunng87

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 gist:f93aa839b96cc16e13ba2e6d594cc4fb
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
View camelcase-to-delimetered.clj
(defn camelcase-to-delimitered [k delimeter]
(->> (clojure.string/split k #"(?=[A-Z])")
(map clojure.string/lower-case)
(clojure.string/join delimeter)))
(defn camelcase-to-delimitered-keys [m delimiter]
(let [trans (fn [[k v]]
(let [[strfn keyfn] (if (keyword? k)
[name keyword]
[identity identity])
View gist:e75e692f01b742aaf24dc1eee588ae09
INFO [epollEventLoopGroup-2-6] 2018-08-26 11:33:10,003 - Unexpected exception during request; channel = [id: 0xf72d6e2f, L:/ - R:/]$NativeIoException: readAddress() failed: Connection timed out
at ~[netty-all-4.0.44.Final.jar:4.0.44.Final]
at ~[netty-all-4.0.44.Final.jar:4.0.44.Final]
at ~[netty-all-4.0.44.Final.jar:4.0.44.Final]
at ~[netty-all-4.0.44.Final.jar:4.0.44.Final]
at$EpollStreamUnsafe.epollInReady( ~[netty-all-4.0.44.Final.jar:4.0.44.Final]
sunng87 / Cargo.lock.diff
Created Nov 9, 2016
Diff for Cargo lock
View Cargo.lock.diff
diff --git a/Cargo.lock b/Cargo.lock
index a2e127d..d593db6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,119 +2,191 @@
name = "cargo-release"
version = "0.6.1-pre"
dependencies = [
- "clap 2.2.5 (registry+git://",
- "quick-error 0.1.4 (registry+git://",
sunng87 /
Created Apr 24, 2016
A file base blocking queue
import com.squareup.tape.FileObjectQueue;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
sunng87 /
Created Mar 22, 2016
test if p12 certificate is valid or not
openssl pkcs12 -in $1 -nodes -out $TEMP_KEY
openssl s_client -connect -cert $TEMP_KEY -key $TEMP_KEY
sunng87 /
Last active Aug 21, 2018
i3blocks openweathermap

openweathermap for i3blocks


  • i3blocks
  • httpie
  • jq
  • ttf-font-icons (aur)



Keybase proof

I hereby claim:

  • I am sunng87 on github.
  • I am sunng ( on keybase.
  • I have a public key whose fingerprint is ED91 D234 CAE9 7367 9AD4 6EA6 2E27 E20F C4DE EA3E

To claim this, I am signing this object:

sunng87 / reflection.clj
Created Nov 20, 2015
clojure: access private field/method via reflection
View reflection.clj
(defn invoke-private-method [obj fn-name-string & args]
(let [m (first (filter (fn [x] (.. x getName (equals fn-name-string)))
(.. obj getClass getDeclaredMethods)))]
(. m (setAccessible true))
(. m (invoke obj args))))
(defn private-field [obj fn-name-string]
(let [m (.. obj getClass (getDeclaredField fn-name-string))]
(. m (setAccessible true))
(. m (get obj))))
View gist:536b67d9014fc5428443
(defn assoc-some [m & kvs]
(if-not (even? (count kvs))
(throw (IllegalArgumentException. "even number of key-values required."))
(if-let [kvs (not-empty (filter #(some? (second %)) (partition 2 kvs)))]
(apply assoc m (flatten kvs))
You can’t perform that action at this time.