Skip to content

Instantly share code, notes, and snippets.

Avatar

Christoph Matthies chrisma

View GitHub Profile
@chrisma
chrisma / bibtex_from_doi.sh
Last active Apr 20, 2020
Get BibTeX entry from doi.org
View bibtex_from_doi.sh
wget -qO- --header="Accept: application/x-bibtex" "https://doi.org/10.1109/5.771073"
@chrisma
chrisma / wizard_duel.py
Last active Mar 10, 2020
Coding exercise
View wizard_duel.py
#!/usr/bin/env python3
# In this bonus challenge, you'll need to check the winner of the battle but this time, a sorcerer wins if he succeeds in winning 3 spell clashes in a row.
#
# 1. Create variables POWER, gandalf and saruman as seen above.
#
# spells have names, dictionary that associates that name to a power.
POWER = {
'Fireball': 50,
@chrisma
chrisma / minify_bib.sh
Created Mar 6, 2019
Minify .bib files to contain only references cited in a paper. Remove abstracts.
View minify_bib.sh
bibexport -o extracted.bib main.aux
echo "delete.field = { abstract }" > remove-abs.rsc && bibtool -r remove-abs.rsc extracted.bib -o minified.bib
View gist:437820ce15db30770975e47750c7dd0e
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 Jun 6, 2018
postactivate script to show current Python version in virtualenv
View postactivate.sh
#!/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 Jan 22, 2018
Python GUI for reMarkable sync script
View sync_gui.py
#!/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 Dec 12, 2017
Disable notifications on startup by Guake Terminal 0.8.8
View disable_guake_notifications.sh
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 Dec 4, 2017
Change login screen background Ubuntu 17.10 using GDM
View change_login_background.txt
#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 / latex-cheatsheet-template.tex
Created Sep 22, 2017 — forked from alexander-yakushev/latex-cheatsheet-template.tex
Beautiful cheatsheet template for key bindings, compiled with XeLaTeX
View latex-cheatsheet-template.tex
\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 / api.py
Created May 8, 2017
Use an API in Python
View api.py
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
You can’t perform that action at this time.