Skip to content

Instantly share code, notes, and snippets.

@bdarcus
bdarcus / saxon
Created June 5, 2020 15:42 — forked from dirkk/saxon
Saxon bash script
#!/usr/bin/env bash
SAXON="/opt/saxon"
# Core and library classes
# CP="$SAXON/saxon9he.jar"
CP="$CP$(for JAR in "$SAXON"/*.jar; do echo -n ":$JAR"; done)"
# Options for virtual machine
VM=-Xmx512m
@bdarcus
bdarcus / config
Created May 2, 2021 00:20 — forked from pksunkara/config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
[sendemail]
smtpencryption = tls
@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 <mail@nicolasgoaziou.fr>
;; 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 / 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 / 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 / ..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 / academic.el
Created November 29, 2021 01:13 — forked from rka97/academic.el
Configuration I use in Doom Emacs as part of my academic reading/notetaking workflow
;; The following packages are needed:
;; 1. elfeed and elfeed-score (available from the rss doom module)
;; 2. citar
;; 3. org-ref
;; 4. org-roam and org-roam-bibtex
(defconst robo/bib-libraries (list "~/bib-lib/robo-lib.bib" "~/bib-lib/robo-temp-lib.bib")) ; All of my bib databases.
(defconst robo/main-bib-library (nth 0 robo/bib-libraries)) ; The main db is always the first
(defconst robo/main-pdfs-library-paths `("~/bib-lib/pdfs/" "/home/robo/bib-lib/temp-pdfs/")) ; PDFs directories in a list
(require 'citar)
(defvar bibtex-note-org-property "Key"
"The org-mode property which BibTeX keys are attached to")
(defun get-first-citar-notes-path ()
"Return 'citar-notes-paths' if it is a string, or its car
if it is a list (as 'citar' normally expects)"
(cond ((stringp citar-notes-paths) citar-notes-paths)
((listp citar-notes-paths) (car citar-notes-paths))
@bdarcus
bdarcus / .emacs
Last active October 3, 2022 11:54 — forked from DogLooksGood/.emacs
Meow dot emacs
(require 'package)
(package-initialize)
(setq package-selected-packages
'(modus-themes
vertico
meow
corfu
consult
orderless
@bdarcus
bdarcus / multi-level-sort.rs
Created June 9, 2023 21:14 — forked from chux0519/multi-level-sort.rs
multi level sort in rust
/// Multi-level sort a slice of Foobars according to [(field, reverse)]
fn sort_by_names(f: &mut [Foobar], orderings: &[(Foofields, bool)]) {
use std::cmp::Ordering;
f.sort_by(|a, b| {
let mut cmp = Ordering::Equal;
for (field, reverse) in orderings {
if cmp != Ordering::Equal {
break;
}