Skip to content

Instantly share code, notes, and snippets.

View andersjohansson's full-sized avatar

Anders Johansson andersjohansson

View GitHub Profile
@andersjohansson
andersjohansson / userChrome.css
Last active December 5, 2019 10:47 — forked from shvchk/userChrome.css
Floating auto-shrinking sidebar for vertical tabs via Tab Center Redux. Video demo: https://youtu.be/Y_rTY8tTAO8
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
@-moz-document url("chrome://browser/content/browser.xul") {
/* Windows users might also want to consider setting
* browser.tabs.drawInTitlebar to false in about:config
*/
#TabsToolbar {
visibility: collapse !important;
}
@andersjohansson
andersjohansson / cleanZoteroReport.js
Last active December 2, 2019 14:59
Clean up zotero reports by using javascript in the browser console (or in a bookmarklet).
// USAGE:
// 1. Save the zotero report and open it in your web browser.
// 2. Open the browser’s web console
// (in Firefox: Menu>Web Developer>Web console (or CTRL+SHIFT+K))
// (in Chrome: Menu>More Tools>Developer tools)
// 3. Customize the lists below by commenting out fields you want to keep
// 4. Copy and paste the code into the web console and run it.
// 5. Your report should be cleaned up and ready to print etc.
// ALTERNATIVE USAGE (bookmarklet):
@andersjohansson
andersjohansson / grading.org
Last active April 12, 2016 08:21
Some functions for grading student papers in Emacs with org-mode

Grading table

NamePointsGradewcid
Smith, Joan10ASmith_Joan
Smith, John7BSmith_Johan

Evaluations

@andersjohansson
andersjohansson / emacs-zotero-bib-fetch.el
Created March 31, 2016 10:05
Emacs-zotero-bib-fetch: fork of zotelo to use better-bibtex's pull export
;;; emacs-zotero-bib-fetch.el --- Manage Zotero collections from emacs
;;
;; Filename: emacs-zotero-bib-fetch.el
;; Author: Anders Johansson, based on zotelo by Spinu Vitalie
;; Maintainer: Anders Johansson
;; Copyright (C) 2011-2014, Anders Johansson and Spinu Vitalie
;; Created: 1 Jul 2014
;; Version: 1.2
;; URL: https://github.com/andersjohansson/emacs-zotero-bib-fetch
;; Keywords: zotero, emacs, reftex, bibtex, bibliography manager
@andersjohansson
andersjohansson / effective-config.log
Last active March 9, 2016 15:50
Log output from mopidy, slow startup, loading spotify playlists
[core]
cache_dir = $XDG_CACHE_DIR/mopidy
config_dir = $XDG_CONFIG_DIR/mopidy
data_dir = $XDG_DATA_DIR/mopidy
max_tracklist_length = 10000
[logging]
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
@andersjohansson
andersjohansson / org-mode-inline-comments.el
Created October 25, 2015 21:13
org-mode inline comments
;;; Exporting
(add-hook 'org-export-before-parsing-hook #'aj/ox-inline-comment)
(defun aj/ox-inline-comment (backend)
(when (member backend '(latex odt))
(save-excursion
(goto-char (point-min))
(while (search-forward-regexp
"\\(?3:\\[[^\]]+\\] \\)?\\(?1:[^❱❙]+\\)\\(?:❙\\(?3:\\[[^\]]+\\] \\)?\\(?2:[^❱]+\\)\\)?❱"
nil t)
@andersjohansson
andersjohansson / helm-org-clock-select-task.el
Created June 11, 2015 12:14
org-clock-select-task with helm
(advice-add 'org-clock-select-task :override #'aj/helm-org-clock-select-task)
(defun aj/helm-org-clock-select-task (&optional prompt)
"Select a task that was recently associated with clocking."
(interactive)
;; TODO sources for these
;; (when (marker-buffer org-clock-default-task)
;; (insert (org-add-props "Default Task\n" nil 'face 'bold))
;; (setq s (org-clock-insert-selection-line ?d org-clock-default-task))
@andersjohansson
andersjohansson / aj-org-zotxt-configuration.el
Last active November 12, 2022 16:44
Using org-zotxt with working export to odt scannable by odf/rdf scan (http://zotero-odf-scan.github.io/zotero-odf-scan/) and using pandoc cite-syntax. This depends on org-pdcite (https://gitlab.com/egh/org-pdcite/). I use it with extended allowed characters, this branch: https://gitlab.com/andersjohansson/org-pdcite/commits/aj-extensions. BibLaT…
(require 'org-zotxt)
(require 'org-pdcite)
(setq org-zotxt-link-description-style :betterbibtexkey)
(org-add-link-type
"zotero"
(lambda (rest)
(zotxt-select-key (substring rest 15)))
#'aj/org-zotero-link))