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 / 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 / Readme.md
Created February 13, 2014 10:04
Run vim reindent and retab from command line

Reindent and retab any file with vim from the shell

Vim has some pretty nice standarts on what indention etc. should look like, so it might make sense to run those from the command line on files without haveing to launch vim by hand. This is how it is done:

$ vim myfile.rb -s format.vim

Will execute all the commands specified in format.vim against the myfile.rb. The commands can be anything possible in vim in normal mode, so my example script will reindent the whole file (gg=G) and retab according to the rules, followed by a save.

@sideshowcoder
sideshowcoder / .vimrc
Created December 9, 2014 17:42
Clear the vim quickfix list
function ClearQuickfixList()
call setqflist([])
endfunction
command! ClearQuickfixList call ClearQuickfixList()
nmap <leader>cf :ClearQuickfixList<cr>
@sideshowcoder
sideshowcoder / git-link-sourcegraph.el
Last active March 24, 2021 05:52
Configure git-link for sourcegraph
@sideshowcoder
sideshowcoder / erl
Last active June 4, 2020 12:20
debug erlang nif code with lldb
#!/bin/sh
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 1996-2012. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
(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 / run_eunit.sh
Created February 23, 2014 12:48
Run Erlang EUnit from the shell
# replace ERLANG_MODULE with the module you try to test, i.e. calc
erlc -DTEST ERLANG_MODULE.erl && erl -noshell -pa . -eval "eunit:test(ERLANG_MODULE, [verbose])" -s init stop
;;; 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)