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
Created February 7, 2021 20:16
shackle
(defun rk/open-compilation-buffer (&optional buffer-or-name shackle-alist shackle-plist)
"Helper for selecting window for opening *compilation* buffers."
;; find existing compilation window left of the current window or left-most window
(let ((win (or (loop for win = (if win (window-left win) (get-buffer-window))
when (or (not (window-left win))
(string-prefix-p "*compilation" (buffer-name (window-buffer win))))
return win)
(get-buffer-window))))
;; if the window is dedicated to a non-compilation buffer, use the current one instead
(when (window-dedicated-p win)
*** 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 / 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)
@rksm
rksm / init-go-public.el
Created June 14, 2018 09:02
emacs go setup
;; -*- no-byte-compile: t; -*-
;;
;; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"
setup
export GOPATH=$HOME/goprojects
go get -u github.com/nsf/gocode
go get golang.org/x/tools/cmd/guru
@rksm
rksm / init.el
Created January 20, 2018 09:59
tide (typescript emacs package) - override typescript server for remote support via tramp
(defun rk/tide-start-server-process (node-executable tsserverjs)
""
(let* ((tramp-p (tramp-tramp-file-p tsserverjs))
(tsserverjs (if tramp-p
(tramp-file-name-unquote-localname
(tramp-dissect-file-name tsserverjs))
tsserverjs))
(process (if tramp-p
(start-file-process "tsserver" buf
"bash" "--login" "-c"