Skip to content

Instantly share code, notes, and snippets.

View chrisma's full-sized avatar

Christoph Matthies chrisma

View GitHub Profile
@chrisma
chrisma / latex-cheatsheet-template.tex
Created September 22, 2017 11:52 — forked from alexander-yakushev/latex-cheatsheet-template.tex
Beautiful cheatsheet template for key bindings, compiled with XeLaTeX
\documentclass[10pt,english,landscape]{article}
\usepackage{multicol}
\usepackage{calc}
\usepackage[landscape]{geometry}
\usepackage{color,graphicx,overpic}
\usepackage[T1]{fontenc}
\usepackage[bitstream-charter]{mathdesign}
\usepackage[utf8]{inputenc}
\usepackage{url}
@chrisma
chrisma / minify_bib.sh
Created March 6, 2019 15:05
Minify .bib files to contain only references cited in a paper. Remove abstracts.
bibexport -o extracted.bib main.aux
echo "delete.field = { abstract }" > remove-abs.rsc && bibtool -r remove-abs.rsc extracted.bib -o minified.bib
@chrisma
chrisma / gist:437820ce15db30770975e47750c7dd0e
Last active December 11, 2018 15:12 — forked from barentsen/gist:bacd4360fb31e7456d659d07b014e834
How to get clickshare working on Ubuntu
sudo apt install libresample1
http://mirrors.kernel.org/ubuntu/pool/universe/liba/libav/libavutil52_9.20-0ubuntu0.14.04.1_amd64.deb
sudo gdebi libavutil52_9.18-0ubuntu0.14.04.1_amd64.deb
http://security.ubuntu.com/ubuntu/pool/universe/liba/libav/libswscale2_9.20-0ubuntu0.14.04.1_amd64.deb
sudo gdebi libswscale2_9.18-0ubuntu0.14.04.1_amd64.deb
# Download clickshare deb
# https://drive.google.com/drive/folders/0B9IKZqXvLKM_Yno1UmpGLVRXNDg
# https://drive.google.com/file/d/0B9IKZqXvLKM_QzF4aTlRNVV5Wk0/view
sudo gdebi clickshare_01.07.01-79_amd64.deb
@chrisma
chrisma / postactivate.sh
Created June 6, 2018 12:33
postactivate script to show current Python version in virtualenv
#!/usr/bin/zsh
# This hook is sourced after this virtualenv is activated.
echo $fg_bold[green] $(python --version)
echo $fg_bold[green] $(which python)
@chrisma
chrisma / sync_gui.py
Created January 22, 2018 15:52
Python GUI for reMarkable sync script
#!/usr/bin/env python3
import os
import tkinter as tk
from tkinter import filedialog
from tkinter import ttk
from tkinter import scrolledtext
import time
import threading
@chrisma
chrisma / disable_guake_notifications.sh
Created December 12, 2017 17:10
Disable notifications on startup by Guake Terminal 0.8.8
guake --no-startup-script # Should give info on how to disable popups
# For Guake Terminal 0.8.8 the following command is used
gconftool-2 --type bool --set /apps/guake/general/use_popup false
@chrisma
chrisma / change_login_background.txt
Last active December 4, 2017 12:49
Change login screen background Ubuntu 17.10 using GDM
#http://ubuntuhandbook.org/index.php/2017/10/change-login-screen-background-ubuntu-17-10/
sudo cp ~/Pictures/landscape.png /usr/share/backgrounds/
xhost +local: && sudo gedit /etc/alternatives/gdm3.css
#lockDialogGroup {
background: #000000 url(file:///usr/share/backgrounds/landscape.png);
background-repeat: no-repeat;
background-size: cover;
background-position: center; }
@chrisma
chrisma / easy_linebreak_in_table_cell.tex
Last active December 4, 2017 11:27
Easy forced line break in a table cell in Latex
\begin{table}
\centering
\caption{Your caption.}
\begin{tabular}{|p{2cm}|l|} \hline %Within a 'p' column \newline is defined
A long \newline text & Another text\\ \hline
\end{tabular}
\end{table}
@chrisma
chrisma / api.py
Created May 8, 2017 15:13
Use an API in Python
from requests import get
# Some more ideas: https://www.programmableweb.com/category/humor/api
data = get('https://api.chucknorris.io/jokes/random').json()
joke = data['value']
print joke
@chrisma
chrisma / right_click_new.sh
Created May 5, 2017 10:16
Enable right-click file creation in nautilus
touch ~/Templates/txt.txt
touch ~/Templates/sh.sh