Skip to content

Instantly share code, notes, and snippets.

@bdarcus
bdarcus / ..git-pr.md
Created October 26, 2021 12:22 — forked from gnarf/..git-pr.md
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@bdarcus
bdarcus / csl-validate.sh
Created October 19, 2021 13:25
a simple wrapper script to validate CSL files using the very fast RNV XML parser
#!/usr/bin/env bash
# a simple wrapper script to validate CSL files using the very fast RNV XML parser
SCHEMA="~/Code/csl/schema/schemas/styles/csl.rnc"
STYLE=$1
rnv $SCHEMA $STYLE
@bdarcus
bdarcus / org-airmail.el
Last active September 2, 2021 14:13 — forked from ephsmith/org-airmail.el
org-airmail.el adds an org-hyperlink handler for Airmail email URLs
;;; org-airmail.el - Support for links to Airmail 3 messages in Org
(require 'org)
(org-link-set-parameters "airmail" :follow 'org-airmail-open)
(defun org-airmail-open (url)
"Visit the Airmail message referenced by URL.
URL should be a vaid Airmail message url retrieved from Airmail with
'Copy Message Link'."
@bdarcus
bdarcus / org-roam-configuration.el
Created August 24, 2021 12:33 — forked from jeremyf/org-roam-configuration.el
org-roam configuration
;; See
;; http://takeonrules.com/2021/08/22/ever-further-refinements-of-org-roam-usage/
;; for details on this configuration.
;;
;; See https://takeonrules.com/2021/08/23/diving-into-the-implementation-of-subject-menus-for-org-roam/
;; for a walk through of the implementation.
;;
;; A Property List of my `org-roam' capture templates.
(setq jnf/org-roam-capture-templates-plist
(list
@bdarcus
bdarcus / bibliography.el
Last active August 13, 2021 16:01
setup for bibtex-actions and org-cite
(use-package bibtex-actions
:after (bibtex-completion)
:config
(setq bibtex-completion-bibliography '("~/references.bib")))
(use-package oc
:load-path "~/org-mode/lisp"
:after (org bibtex-completion)
:config
(setq org-cite-global-bibliography
@bdarcus
bdarcus / oc-csl.el
Created July 27, 2021 13:16 — forked from andras-simonyi/oc-csl.el
A patched version of oc-csl which supports a larger set of citation modes and variants plus adds biblatex support
;;; oc-csl.el --- csl citation processor for Org -*- lexical-binding: t; -*-
;; Copyright (C) 2021 Free Software Foundation, Inc.
;; Author: Nicolas Goaziou <[email protected]>
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
@bdarcus
bdarcus / styles.el
Last active July 23, 2021 19:48
flatten org-cite-supported-styles
;; https://github.com/jkitchin/org-ref/issues/885#issuecomment-885682807
;; doesn't currently handle the nil style correctly
(defun oc-bibtex-actions--simple-styles (&optional targets)
(let ((styles (org-cite-supported-styles targets)))
(cl-loop for group in styles append
(let ((main (pop group)))
(when (string= "nil" (car main)) (setf (car main) ""))
(append (list (car main))
(cl-loop for rest in group collect
;; needs to remove "/nil"
@bdarcus
bdarcus / pretty-hyperref.md
Created July 16, 2021 13:10
hyperref config

Turn all links "MidnightBlue":

% https://tex.stackexchange.com/questions/100905/best-practice-for-hyperref-link-colours
\usepackage[dvipsnames]{xcolor}
\newcommand\myshade{85}

\hypersetup{
 colorlinks = true,
 allcolors = MidnightBlue!\myshade!black,
@bdarcus
bdarcus / crm.el
Created June 30, 2021 12:46
vertico crm experiments
; some experimental code from minad, to improve CRM experience
(defun vertico--crm-indicator (args)
"Add prompt indicator, modify ARGS passed to `completing-read-multiple'."
(cons (concat "[CRM] " (car args)) (cdr args)))
(defun vertico--crm-separator (&rest _)
"Add separator between selected items, when inserting."
(when (eq minibuffer-completion-table #'crm--collection-fn)
;; You may want to use something else than ", ".
(insert ", ")))
@bdarcus
bdarcus / cite-init.el
Last active October 3, 2021 12:42
org-cite testing init, instructions
;; to test org-cite-new branch:
;;
;; 1. run 'make' from the org-mode repo wip-cite-new branch root
;;
;; 2. run ...
;;
;; ... this for basic citation testing:
;;
;; emacs -Q -l cite-init.el
;;