Skip to content

Instantly share code, notes, and snippets.

mping /
Created Jul 4, 2022 — forked from rizalgowandy/
Programming media keys on the Ducky One 2 Skyline

Programming Media Keys on the Ducky One 2

To use media keys on the Ducky One 2, you must record a macro to bind the media function to a hotkey combination, i.e. Fn plus some key.


Important: In the instructions below, "Press X+Y+Z" means press and hold key X, press and hold key Y, press and hold key Z in that order, and then release all three.

As an example, to bind Fn+PgUp to the play/pause media function:

View either.clj
(require '[clojure.spec.alpha :as s])
(s/def ::test (s/and (s/keys :req-un [(or ::key1 ::key2)])
(fn [{:keys [key1 key2]}]
(not (and key1 key2)))))
;; s/or validates some of the keys
;; the (fn..) ensures that both keys CANNOT be present
mping /
Created Sep 22, 2018 — forked from Deraen/
Compojure-api and Buddy
  • (:identity req) is auth backend independent way to access user data
  • login and logout implementation depends on auth backend
  • :current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required
mping /
Last active Jun 9, 2018 — forked from abravalheri/
RFC: Git Commit Message Guidelines

Commit Message Guidelines


  • allow generating by script
  • allow ignoring commits by git bisect (not important commits like formatting)
  • provide better information when browsing the history



Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea

mping / Main.scala
Created Jul 3, 2017 — forked from sujoyu/Main.scala
Scala parser combinator sample like HTML tag.
View Main.scala
import scala.util.parsing.combinator._
import scala.language.postfixOps
object Main {
def main(args:Array[String]) = {
val sc = new java.util.Scanner(
val input = collection.mutable.ListBuffer[String]()
while(sc.hasNextLine) {
input += sc.nextLine
mping / build.boot
Created May 27, 2017 — forked from bartojs/build.boot
gmail rest api java/clojure example with oauth2 and labels
View build.boot
;; 1) first goto
;; -- to turn on gmail api for your account
;; 2) then create a oauth consent with app name
;; 3) then add oauth clientid and download to ./clientsecret.json
;; 4) boot run
;; -- when running first time a browser will open to accept authorizaton
(set-env! :dependencies '[[ "v1-rev34-1.21.0"]
[ "1.20.0"]
[ "1.20.0"]])
mping /
Last active Sep 1, 2016 — forked from tsabat/
Getting oh-my-zsh to work in Ubuntu


apt-get install zsh
apt-get install git-core


Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

mping /
Last active Jun 14, 2016 — forked from nicerobot/
Run jstatd w/o error 'access denied (java.util.PropertyPermission java.rmi.server.ignoreSubClasses write)'

Socks Proxy


Add Remote Host


Add Jstad Connection