Skip to content

Instantly share code, notes, and snippets.

Phil Chiu whophil

Block or report user

Report or block whophil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
whophil / jupyter.service
Last active Mar 27, 2020 — forked from doowon/jupyter_systemd
A systemd script for running a Jupyter notebook server.
View jupyter.service
# After Ubuntu 16.04, Systemd becomes the default.
# It is simpler than
Description=Jupyter Notebook
ExecStart=/home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config=/home/phil/.jupyter/
whophil / config.xml
Last active Jan 10, 2020
KVM XML configuration file for Windows 8 HTPC with VGA, USB controller passthrough on ASRock FM2A78M-ITX.
View config.xml
<domain type='kvm' id='1'>
<vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
whophil /
Last active Aug 2, 2018
Recursive glob in Python: Find all files matching a glob-style pattern. Adapted from
import os
import fnmatch
def recursive_glob(rootdir='.', pattern='*'):
"""Search recursively for files matching a specified pattern.
Adapted from
matches = []
whophil /
Last active Jan 19, 2017
Bash scripts for making life with Sun Grid Engine (SGE) easier.
# A collection of bash functions for working with SGE.
# Installation
# ------------
# Install at the command prompt
# $ . /path/to/
# Or, add this line to your ~/.bashrc
whophil / jupyter-style.ipynb
Last active Mar 12, 2020
Pretty style for Jupyter notebooks using Google web-fonts. Apply to all your notebooks using %run magic.
View jupyter-style.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
whophil /
Last active Apr 19, 2016
Recursively search for and submit (qsub) files matching a pattern.
#!/usr/bin/env python
"""Recursively search for and submit (qsub) files matching a pattern."""
import os
import sys
import argparse
import subprocess
import fnmatch
whophil /
Last active Apr 17, 2016 — forked from arthurd2/
Produces a diff PDF of a LaTeX repo against a specified hash using latexdiff.
#!/usr/bin/env bash
# Shell script to run latexdiff against the same file from a specified commit hash.
# Example:
# ./ main.tex 12dfa1a
# $1 is the name of the old tex file (relative to the remote repo)
# $2 is the hash of the commit that we'd like to compare against
whophil /
Last active Apr 11, 2016
Configuration for Sphinx readthedocs html theme.
# requires sphinx_rtd_theme to be installed on the build machine
# $ pip install sphinx_rtd_theme
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
whophil /
Last active Apr 11, 2016
Sphinx extensions: autodoc, napoleon
sys.path.insert(0, os.path.abspath('.'))
extensions = [
whophil /
Last active Apr 7, 2016
Docstring for Python method (NumPy-style, for Sphinx compatibility)
"""One line description of a module level function.
The longer, optionally multi-line description goes here. This may have multiple
sentences and multiple lines.
param1 : int
The first parameter.
param2 : Optional[str]
You can’t perform that action at this time.