Skip to content

Instantly share code, notes, and snippets.

View jgosmann's full-sized avatar

Jan Gosmann jgosmann

View GitHub Profile
@jgosmann
jgosmann / .minttyrc
Created May 31, 2019 11:08
My MinTTY config
View .minttyrc
Font = Liberation Mono
FontHeight = 10
Columns = 120
Rows = 40
Locale = en_US
Charset = UTF-8
CursorType = block
ForegroundColour=131, 148, 150
BackgroundColour= 0, 43, 54
View .minttyrc
Font = Liberation Mono
FontHeight = 10
Columns = 120
Rows = 40
Locale = en_US
Charset = UTF-8
CursorType = block
ForegroundColour=131, 148, 150
BackgroundColour= 0, 43, 54
@jgosmann
jgosmann / .ideavimrc
Created December 15, 2018 19:15
IdeaVim key remappings
View .ideavimrc
" Neo2 remappings
noremap s h
noremap n gj
noremap r gk
noremap t l
" kill
noremap k s
" jump
noremap j n
" hide
@jgosmann
jgosmann / conf.py
Created June 7, 2018 18:41
Select Jupyter kernel for nbsphinx.
View conf.py
if 'NENGO_NBSPHINX_KERNEL' in os.environ:
nbsphinx_kernel_name = os.environ['NENGO_NBSPHINX_KERNEL']
else:
from jupyter_client.kernelspecapp import KernelSpecManager
kernels = sorted(KernelSpecManager().find_kernel_specs())
print("Available Jupyter kernels:")
for i, kernel in enumerate(kernels):
print(" {}. {}".format(i + 1, kernel))
nbsphinx_kernel_name = None
while nbsphinx_kernel_name not in kernels:
@jgosmann
jgosmann / format-latex.py
Created January 20, 2017 20:54
Format latex with one sentence per line
View format-latex.py
import re
import sys
import pyparsing as pp
escaped = pp.Combine(
pp.Literal('\\') + pp.CharsNotIn('', exact=1)).setResultsName('percent').leaveWhitespace()
comment = pp.Combine(pp.Literal('%') + pp.restOfLine).setResultsName('comment').leaveWhitespace()
args = pp.Forward()
group = pp.Forward()
View virtualenv-select
#!/usr/bin/env python
"""Run either pyvenv or virtualenv depending on the version of Python used.
To use this with virtualenvwrappper, install it into a directory on your
``PATH`` as 'virtualenv-select' and add the following to your
``~/.bashrc``:
export VIRTUALENVWRAPPER_VIRTUALENV=virtualenv-select
.. note::
@jgosmann
jgosmann / pre-push
Created June 16, 2016 15:17
Prevent pushing fixup, squash, and WIP commits to master.
View pre-push
#!/bin/sh
# An example hook script to verify what is about to be pushed to master. Called
# by "git push" after it has checked the remote status, but before anything has
# been pushed. If this script exits with a non-zero status nothing will be
# pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
View jupyter_notebook_config.py
# Configuration file for ipython-notebook.
c = get_config()
c.IPKernelApp.matplotlib = 'inline'
#------------------------------------------------------------------------------
# NotebookApp configuration
#------------------------------------------------------------------------------
# NotebookApp will inherit config from: BaseIPythonApplication, Application
View jupyter_qtconsole_config.py
c = get_config()
c.JupyterWidget.font_size = 11
c.JupyterWidget.height = 30
c.JupyterWidget.width = 140
c.JupyterWidget.syntax_style = 'solarizedlight'
c.JupyterQtConsoleApp.confirm_exit = False
@jgosmann
jgosmann / 00-runcom.ipy
Created July 30, 2015 19:39
IPython startup file
View 00-runcom.ipy
import matplotlib.pyplot as plt
import nengo
from nengo import spa
import numpy as np
import pandas as pd
import seaborn as sns