All prefixed by local leader, which is \
in my case.
:disconnect "cd"
:connect-port-file "cf"
:interrupt "ei"
:last-exception "ex"
:view-source "es"
;; This previously was CLJX but has now been updated to use cljc. Thanks @caskolkm | |
;; https://gist.github.com/caskolkm/39d823f5bac7051d3062 | |
(ns app.logging | |
(:refer-clojure :exclude [time]) | |
(:require #?(:clj [clojure.tools.logging :as log] | |
:cljs [goog.log :as glog])) | |
#?(:cljs (:import goog.debug.Console))) | |
#?(:cljs |
;; Auto-scrolling ============================================================== | |
(defn scroll! [el start end time] | |
(.play (goog.fx.dom.Scroll. el (clj->js start) (clj->js end) time))) | |
(defn scrolled-to-end? [el tolerance] | |
;; at-end?: element.scrollHeight - element.scrollTop === element.clientHeight | |
(> tolerance (- (.-scrollHeight el) (.-scrollTop el) (.-clientHeight el)))) | |
(defn autoscroll-list [{:keys [children class scroll?] :as opts}] |
A small babashka script to convert HTML from stdin to hiccup and pretty print it.
I use this inside NeoVim with this config line
command PasteAsHiccup r !pbpaste | html2hiccup
And then whenever I want to paste some HTML as Hiccup I'll do :PasteAsHiccup
.
(ns oxygen.client | |
"A minimal Clojure client for Airtable.com's HTTP API. | |
Supports retrieval of whole tables as well as individual records. | |
Dependencies: [org.clojure/data.json \"0.2.6\"] [clj-http \"2.0.0\"]" | |
(:require [clojure.data.json :as json] | |
[clojure.string :as string] | |
[clojure.set :as set] | |
[clj-http.client :as client])) | |
(def api-base "https://api.airtable.com/v0") |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Instruct an AVM FRITZ!Box via UPnP_ to reconnect. | |
This is usually realized with tools like Netcat_ or cURL_. However, when | |
developing in Python_ anyway, it is more convenient to integrate a native | |
implementation. This one requires Python_ 2.5 or higher. | |
UPnP_ (Universal Plug and Play) control messages are based on SOAP_, which is |
deps.lua
is an all-in-one script containing your declarative list of dependencies and installing any missing ones.
Kind of like Clojure's deps.edn
except that the dependencies and code to download them are bundled in one package.
.fnl
, download fennel.lua
and compile to respective .lua
file location{ | |
"description": "Change caps_lock to command+control+option+shift.", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "caps_lock", | |
"modifiers": { | |
"optional": [ | |
"any" | |
] |
(require '[clojure.string :as s]) | |
;; My initial attempt | |
(def c [:0 :1 :2 :3 :4 :5 :6 :7 :8 :9 :A :B :C :D :E :F]) | |
(str "#" (s/join (map name (repeatedly 6 #(rand-nth c))))) | |
;; Another option not using keywords (/ht locks in #clojure) | |
(def c [0 1 2 3 4 5 6 7 8 9 \A \B \C \D \E \F]) | |
(str "#" (s/join (repeatedly 6 #(rand-nth c)))) | |
;; the last line can be simplified even more (/ht xificurC in #clojure) |
(I wrote a bit about why Emacs and Vim on my blog and thought it might be nice to give some starting point for people that want to try it.)
If you just want to play around with Emacs & Evil mode do the following:
mkdir ~/.emacs.d/
init.el
into ~/.emacs.d/