Skip to content

Instantly share code, notes, and snippets.

View ZelphirKaltstahl's full-sized avatar

Zelphir Kaltstahl ZelphirKaltstahl

  • Germany
View GitHub Profile
@ZelphirKaltstahl
ZelphirKaltstahl / quickplot.py
Last active August 31, 2016 11:40
customized matplotlib / pyplot plotting code
# use the scratch environment
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import scipy as sp
# create figure and axes
fig = plt.figure(figsize=(8,6))
ax = fig.add_subplot(1, 1, 1)
@ZelphirKaltstahl
ZelphirKaltstahl / markdown.lang
Last active October 20, 2016 23:15
GTKSourceView Language File for Markdown
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: Jean-Philippe Fleury
Copyright (C) 2011 Jean-Philippe Fleury <contact@jpfleury.net>
Author: Zelphir Kaltstahl (improvements:
* mapping some styles to their own specific style in a gtksourceview style xml
* adding math block and inline supprt
* removing bias towards space and allowing tabs and changing some amounts to
arbitrary amounts
@ZelphirKaltstahl
ZelphirKaltstahl / tomorrow_night-eighties.xml
Last active October 20, 2016 23:13
GTKSourceView Style File for Markdown
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2009 tm2gtksw2(Alexandre da Silva)
Author: Zelphir Kaltstahl (improvements:
* added markdown specific styles)
Copyright (c) 2016 Zelphir Kaltstahl <zelphirkaltstahl@gmail.com>
This file was generated from a textmate theme named Tomorrow Night - Eighties
with tm2gtksw2 tool. (Alexandre da Silva)
@ZelphirKaltstahl
ZelphirKaltstahl / racket.lang
Last active October 19, 2016 19:08
GTKSourceView Language file for Racket
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: Paolo Borelli <pborelli@gnome.org>
Copyright (C) 2006-2007 Paolo Borelli
Author: Zelphir Kaltstahl <zelphirkaltstahl@gmail.com>
* further development
* corrections in regular expressions
* addition of functions and keywords
* simplification of keywords with regeular expressions
@ZelphirKaltstahl
ZelphirKaltstahl / ps1-code
Last active September 16, 2017 17:07
PS1 code for my bash
export PS1="\[\033[38;5;78m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;203m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;74m\]\w\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]"
# simple
export PS1="[\[$(tput sgr0)\]\[\033[38;5;194m\]\t\[$(tput sgr0)\]\[\033[38;5;15m\]]:[\[$(tput sgr0)\]\[\033[38;5;111m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]]: \[$(tput sgr0)\]"
@ZelphirKaltstahl
ZelphirKaltstahl / racket.snippets
Created October 23, 2016 21:41
VIM Racket Snippets
snippet def define procedure
define (${1:name} ${2:params})
(${3:code})
snippet define define procedure
define (${1:name} ${2:params})
(${3:code})
snippet defn define procedure
define (${1:name} ${2:params})
@ZelphirKaltstahl
ZelphirKaltstahl / .vimrc
Last active January 10, 2017 10:40
.vimrc
" automatically install vim-plug if git is available
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
@ZelphirKaltstahl
ZelphirKaltstahl / pandoc-template-german.tex
Created November 3, 2016 14:07
Pandoc template for German documents
% BETTER ERROR MESSAGES
\errorcontextlines 10000
% DOCUMENT ATTRIBUTES
\documentclass[11pt, a4paper, parskip=full, openany, twoside]{book}
% 12pt : main font size
% a4paper : paper format
% parskip=full : ???
% openany : no need for an additional (second) pagebreak after a chapter to move new chapters always to the right page
\usepackage[
@ZelphirKaltstahl
ZelphirKaltstahl / pandoc-template-english.tex
Created November 3, 2016 14:08
Pandoc template for English documents
% BETTER ERROR MESSAGES
\errorcontextlines 10000
% DOCUMENT ATTRIBUTES
\documentclass[11pt, a4paper, parskip=full, openany, twoside]{book}
% 12pt : main font size
% a4paper : paper format
% parskip=full : ???
% openany : no need for an additional (second) pagebreak after a chapter to move new chapters always to the right page
\usepackage[
@ZelphirKaltstahl
ZelphirKaltstahl / jiaxian-triangle
Last active February 4, 2017 23:22
Racket implementation for JiaXian triangle
#lang racket
(define (Mb-to-B n) (* n 1024 1024))
(define MAX-BYTES (Mb-to-B 64))
(custodian-limit-memory (current-custodian) MAX-BYTES)
(define nil (list))
(define (string-multiplier a-string factor)
(cond