Skip to content

Instantly share code, notes, and snippets.

View goerz's full-sized avatar

Michael Goerz goerz

View GitHub Profile
@goerz
goerz / An Introduction to Statistical Learning.md
Last active September 7, 2020 08:27
PDF bookmarks for "James, Witten, Hastie, Tibshirani - An Introduction to Statistical Learning" (LaTeX)

This gist contains out.tex, a tex file that adds a PDF outline ("bookmarks") to the freely available pdf file of the book

An Introduction to Statistical Learning with Applications in R, by Gareth James, Daniela Witten, Trevor Hastie and Robert Tibshirani

http://www-bcf.usc.edu/~gareth/ISL/index.html

The bookmarks allow to navigate the contents of the book while reading it on a screen.

@zehfernandes
zehfernandes / pliim-turnOff.scpt
Last active December 17, 2023 22:15
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell

Keybase proof

I hereby claim:

  • I am goerz on github.
  • I am goerz (https://keybase.io/goerz) on keybase.
  • I have a public key whose fingerprint is 1794 FF0B 42B3 3EAB EAC9 2C92 34A7 2F20 57A6 CAA6

To claim this, I am signing this object:

@mdonkers
mdonkers / server.py
Last active May 6, 2024 23:32
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@goerz
goerz / render_sympy_tree.py
Created March 28, 2017 17:55
Render Sympy Expression as graphical tree inside IPython notebook
def render_sympy_tree(expr):
"""Render the given Sympy Expression as a graphical tree, inside an IPython notebook"""
from sympy.printing.dot import dotprint
import tempfile
import subprocess
import os
from IPython.display import SVG
with tempfile.NamedTemporaryFile(mode='w', delete=False) as out_fh:
out_fh.write(dotprint(expr))
subprocess.run(['/usr/bin/dot', '-Tsvg', out_fh.name, '-o', out_fh.name + ".svg"])
@JonnyWong16
JonnyWong16 / sync_playlists_to_users.py
Last active April 20, 2024 12:14
Sync Plex playlists to shared users.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Description: Sync Plex playlists to shared users.
# Author: /u/SwiftPanda16
# Requires: plexapi
from plexapi.exceptions import NotFound
from plexapi.server import PlexServer
@goerz
goerz / TLS_dissipator_superop.ipynb
Last active January 24, 2017 19:27
The Dissipator of a Two-Level-System as an Explicit Superoperator
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@goerz
goerz / rename_amtrak.py
Created February 19, 2016 21:21
Rename Amtrak Tickets
#!/usr/bin/env python
"""command line script that renames a bunch of Amtrak ticket PDF to a more
useful name. Relies on `pdftotext`."""
import os
import re
import logging
from collections import namedtuple
from dateutil.parser import parse as parse_date
from glob import glob
@goerz
goerz / 00_GPG_and_SSH_README.md
Last active December 28, 2018 19:43
Public SSH/GPG keys

Public SSH/GPG Keys

If you would like to give me SSH access to a machine, please append the content of goerz.pub to the ~/.ssh/authorized_keys file.

To send me encrypted files (attachments) by email, use the GPG Key 57a6caa6.asc.

You can verify the GPG keys at https://keybase.io/goerz

@goerz
goerz / doc2markdown.py
Created July 24, 2015 14:44
Convert a word (doc/docx) file to markdown
#!/usr/bin/env python
"""Convert a word (doc/docx) file to markdown"""
import sys
import os
import subprocess
SOFFICE = r'/Applications/LibreOffice.app/Contents/MacOS/soffice'
PANDOC = r'pandoc'