Skip to content

Instantly share code, notes, and snippets.

View rksm's full-sized avatar
🏗️

Robert Krahn rksm

🏗️
View GitHub Profile
@rksm
rksm / init.el
Last active May 31, 2021 23:47
small init.el
(defvar rk/backup-dir (expand-file-name "backup" user-emacs-directory))
(unless (file-exists-p rk/backup-dir)
(mkdir rk/backup-dir))
(setq
backup-by-copying t ; don't clobber symlinks
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
@rksm
rksm / mypy.ini
Last active May 23, 2021 17:06
stricter mypy config
# see https://mypy.readthedocs.io/en/stable/config_file.html#the-mypy-configuration-file
# this makes things more strict and enforces checking non-annotated code
[mypy]
# to keep things clean
warn_redundant_casts = True
warn_unused_ignores = True
# Workaround for bug in MyPy
disallow_subclassing_any = False
*** 2020-02-28 mac os
*** http://xahlee.info/kbd/kinesis_keyboard_howto.html
*** power user mode: progm + shift + esc
*** mount disk: progm + f1
*** normal keys
[q]>[q]
[w]>[w]
[e]>[l]
import { Color, Line, Point, pt, rect, Rectangle, Transform } from "lively.graphics";
import { string, fun, promise, tree, Path as PropertyPath } from "lively.lang";
import { signal } from "lively.bindings";
import { copy, deserializeSpec, ExpressionSerializer } from "lively.serializer2";
export class Morph {
static get properties() {
return {
name: { group: "core" },
@rksm
rksm / foo.el
Created February 25, 2020 22:52
Tag org-pomodoro entries
(defvar my/org-pomodoro-analyzer-tag "POMODORO"
"Tag to add to an org entry when org-pomodoro clocks in.")
(defun my/org-pomodoro-analyzer-advice (_)
"If a pomodoro is running we ensure that it has a tag
`my/org-pomodoro-analyzer-tag'."
(when (org-clock-is-active)
(save-window-excursion
(with-current-buffer (org-clock-is-active)
@rksm
rksm / example_pptx.cljs
Created January 23, 2020 15:38
pptx-to-cljs example
(ns pptx-to-cljs.example-pptx)
(def $Content_Types$$xml "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">
<Default Extension=\"jpeg\" ContentType=\"image/jpeg\"/>
<Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>
<Default Extension=\"xml\" ContentType=\"application/xml\"/>
<Override PartName=\"/ppt/presentation.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\"/>
<Override PartName=\"/ppt/slideMasters/slideMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml\"/>
<Override PartName=\"/ppt/slides/slide1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\"/>
@rksm
rksm / html-drag.cljs
Created July 29, 2019 15:03
clojurescript HTML dragging snippet
(def dragged (atom nil))
(cljs.core/add-watch dragged :drag-watcher (fn [key ref old-state new-state] (println "dragged changed")))
(defn on-drag [evt]
(println "on-drag"))
(defn on-drag-start [evt]
(println "on-drag-start")
(reset! dragged (.-target evt))
(set! (.. evt -target -style -opacity) .5))
@rksm
rksm / trace_cljs_repl_start.clj
Last active July 27, 2019 07:10
trace figwheel start
;; clj -R:figwheel -Sdeps '{:deps {org.clojure/tools.trace {:mvn/version "0.7.10"}}}' -i trace_cljs_repl_start.clj -m figwheel.main -b dev -r
(ns user)
(require '[clojure.tools.trace :as t])
(require 'cljs.main)
(require 'cljs.repl)
(require 'figwheel.main)
(require 'figwheel.repl)
(require 'figwheel.core)
@rksm
rksm / build-livelify-web.js
Created January 4, 2018 11:35
Build livelify-web.js
/*global require, __dirname*/
let fs = require("fs"),
path = require("path"),
files = [
require.resolve("babel-standalone/babel.js"),
require.resolve("systemjs/dist/system.src.js"),
require.resolve("lively.modules/dist/lively.modules.js"),
require.resolve("lively-system-interface/dist/lively-system-interface-only-local.js"),
@rksm
rksm / init.el
Created September 24, 2018 19:24
god-mode setup
(use-package god-mode
:after which-key multiple-cursors
:ensure
:config
(define-key god-local-mode-map (kbd ".") 'repeat)
(global-set-key (kbd "<escape>") 'god-mode-all)
(define-key mc/keymap (kbd "<escape>") 'god-mode-all)
(which-key-enable-god-mode-support)