Skip to content

Instantly share code, notes, and snippets.

View goerz's full-sized avatar

Michael Goerz goerz

View GitHub Profile
@goerz
goerz / EditInNeovim.applescript
Created May 28, 2019 22:26
Use Neovim in iTerm as a GUI editor
on run {input, parameters}
set cmd to ""
if input is not {} then
set filePath to POSIX path of input
set cmd to ":e " & filePath
end if
tell application "iTerm"
set mywindow to (create window with profile "neovim")
tell the current session in mywindow
@goerz
goerz / apsrev4-2-titles.bst
Last active May 13, 2023 08:44
Modified bibtex style based on apsrev4.2 that adds titles for journal articles
%%
%% This is file `apsrev4-2-titles.bst', and is a hand-edited version of apsrev4-2.bst.
%% Its only modification is that it will display titles for articles.
%% Unlike the "longbibliography" option recommended at
%% https://journals.aps.org/revtex/revtex-faq#Bibtex,
%% it does not write out the first names of all authors.
%% The feature of apsrev4.2 to add DOI links is preserved.
%%
%% Author: Michael Goerz <https://michaelgoerz.net>
%%
@goerz
goerz / angularfreq.ipynb
Created April 13, 2019 17:38
Frequencies vs Angular Frequencies in Quantum Dynamics
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@goerz
goerz / terminalfix.vim
Created March 30, 2019 23:51
Settings that solve some weird vim behavior like starting in REPLACE mode (put this at the end of your vimrc)
" Terminal fixes
"
" These originate from some linux distribution's system vimrc. I can't say
" that I understand the details what's going on here, but without these
" settings, I've had problems like vim starting in REPLACE mode for
" TERM=xterm-256color (neovim is fine)
if &term =~? 'xterm'
let s:myterm = 'xterm'
else
@goerz
goerz / Krotov_time_discretization.ipynb
Last active August 5, 2019 07:42
Time Discretization in Quantum Optimal Control
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@goerz
goerz / README.md
Last active January 6, 2019 23:40
Screenshots for jupytext.vim
@goerz
goerz / sample_rise_notebook_66.md
Last active December 31, 2018 20:16
Proposal for jupytext markdown cell metadata (https://github.com/mwouts/jupytext/issues/66)

jupyter: jupytext: text_representation: extension: .md format_name: markdown format_version: '1.0' jupytext_version: 0.8.6 kernelspec: display_name: Python 3

@goerz
goerz / filter_enex.py
Created October 14, 2018 04:43
filter_enex.py
import re
import html
from lxml.etree import tostring
from ever2simple.converter import EverConverter
def my_unescape(s):
s = s.replace("&quot;", "PROTECTEDQUOT=====")
s = html.unescape(s)
s = s.replace("PROTECTEDQUOT=====", "&quot;")
@goerz
goerz / generate_yearly_calendar.py
Created October 7, 2018 15:22
Script to generate a 3-page yearly calendar via luatex
#!/usr/bin/env python
"""Script to generate a yearly calendar via luatex.
Requires the `lualatex` executable to be in the PATH.
Requires the Rotis Semi Serif (55 Roman) and Rotis Semi Sans (55 Regular)
fonts, available at
https://www.linotype.com/49242/rotis-semi-serif-family.html
https://www.linotype.com/49198/rotis-semi-sans-family.html