Skip to content

Instantly share code, notes, and snippets.

View sideshowcoder's full-sized avatar
💭
🐱

Philipp Fehre sideshowcoder

💭
🐱
View GitHub Profile
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: phoenix-main-mariadb
annotations:
volumeType: local
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
@sideshowcoder
sideshowcoder / git-link-sourcegraph.el
Last active March 24, 2021 05:52
Configure git-link for sourcegraph
@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
;;; 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
# 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)

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:

parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \w\$(parse_git_branch) \\$ "
;; 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))))
(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)))
@sideshowcoder
sideshowcoder / rspec_file.el
Created February 9, 2017 14:38
Run rspec on file in emacs (depends on rake.el and projectile)
(defun coder/rspec-file ()
"Run rspec on the current file and set as the compile target,
if we have zeus available than run it via zeus otherwise run it
via bundle exec rspec"
(interactive)
(projectile-with-default-dir (projectile-project-root)
(let ((command-prefix (rake--choose-command-prefix (projectile-project-root) (list :zeus "zeus test "
:bundler "bundle exec rspec "))))
(compile (concat command-prefix (coder/project-relative-current-file-path))))))