Skip to content

Instantly share code, notes, and snippets.

View sideshowcoder's full-sized avatar
💭
🐱

Philipp Fehre sideshowcoder

💭
🐱
View GitHub Profile
(defun coder/go-guru-set-current-package-as-main ()
"GoGuru requires the scope to be set to a go package which
contains a main, this function will make the current package the
active go guru scope, assuming it contains a main"
(interactive)
(let* ((filename (buffer-file-name))
(gopath-src-path (concat (file-name-as-directory (go-guess-gopath)) "src"))
(relative-package-path (directory-file-name (file-name-directory (file-relative-name filename gopath-src-path)))))
(setq go-guru-scope relative-package-path)))
;; automatically open a file as sudo unless we have permission to write it
;; already, after all this is my machine and I can do what I want!
(defadvice ido-find-file (after find-file-sudo activate)
"Find file as root if necessary."
(unless (and buffer-file-name
(file-writable-p buffer-file-name))
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \w\$(parse_git_branch) \\$ "

Keybase proof

I hereby claim:

  • I am sideshowcoder on github.
  • I am sideshowcoder (https://keybase.io/sideshowcoder) on keybase.
  • I have a public key ASAEE-dQHXaxnF5kXmIlTg3XB_YoqdRpORJs-L2ImDIItgo

To claim this, I am signing this object:

# Use Mermaid (https://github.com/knsv/mermaid) and Markdown to create word docs
# with diagrams.
# Requires Pandoc and mermaid pandoc filter to process all md files in the
# current folder to html and the html to docx for word
# see https://github.com/raghur/mermaid-filter
SRC = $(wildcard *.md)
DIA = $(SRC:.md=.html)
DOCS = $(DIA:.html=.docx)
;;; coders-little-helper -- all kind of helper functions
;;
;;; Commentary:
;; Helper functions for all kind of daily Emacs stuff.
;;
;; Run tests on the command line:
;;
;; emacs -batch -l coders-little-helper.el
;;
;; From inside Emacs
@sideshowcoder
sideshowcoder / bloop.el
Last active October 10, 2021 18:54
Bloop integration for Emacs
;;; bloop --- bloop minor mode
;; Author: Philipp Fehre <philipp@fehre.co.uk>
;; Keywords: scala, bloop, tools, convenience
;;; Commentary:
;; Helpers to integrate better with bloop, inspired by emacs-bloop
;; https://github.com/tues/emacs-bloop/blob/master/bloop.el
;; C-c M-j jack-in a bloop project running a new Ammonite REPL buffer
@sideshowcoder
sideshowcoder / git-link-sourcegraph.el
Last active March 24, 2021 05:52
Configure git-link for sourcegraph
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: phoenix-main-mariadb
annotations:
volumeType: local
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path