Skip to content

Instantly share code, notes, and snippets.

@whophil
whophil / .gitignore
Created Feb 21, 2016 — forked from k0d3r/gist:3118874
.gitignore for OS (Windows/Mac) generated files
View .gitignore
# Windows
Thumbs.db
desktop.ini
# OS X
.DS_Store
.Spotlight-V100
.Trashes
._*
@whophil
whophil / jupyter.service
Last active Apr 6, 2021 — 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 https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config=/home/phil/.jupyter/jupyter_notebook_config.py
@whophil
whophil / daylight-derivatives.ipynb
Last active Jan 15, 2021
Computing derivatives of daylight hours
View daylight-derivatives.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@whophil
whophil / Preferences.sublime-settings
Last active Dec 13, 2020
Sublime Text 3 user settings to use Unix style line endings by default (and also show the line ending type in the status bar)
View Preferences.sublime-settings
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/base16-ocean.light (SL).tmTheme",
"default_line_ending": "unix",
"font_size": 12,
"ignored_packages":
[
"Anaconda",
"Monokai Extended",
@whophil
whophil / config.xml
Last active Nov 19, 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'>
<name>Win8-HTPC-OVMF</name>
<uuid>a2c7ea78-f49a-ef5b-6b16-521d098d40c9</uuid>
<metadata>
<vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
</metadata>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<memoryBacking>
<nosharepages/>
@whophil
whophil / jupyter-style.ipynb
Last active Aug 11, 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
whophil / .gitignore
Last active Jan 16, 2019
.gitignore for LaTeX projects (ignoring *.sublime-workspace files)
View .gitignore
## SublimeText Workspace
*.sublime-workspace
## Main PDF file
main.pdf
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
@whophil
whophil / ipython-notebook.conf
Last active Aug 18, 2018
Upstart file (Ubuntu) for Jupyter / IPython notebook
View ipython-notebook.conf
start on filesystem or runlevel [2345]
stop on shutdown
description "Jupyter / IPython Notebook Upstart script"
script
export HOME="/home/phil/Notebooks"; cd $HOME
echo $$ > /var/run/ipython_start.pid
exec su -s /bin/sh -c 'exec "$0" "$@"' phil -- /home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config='/home/phil/.jupyter/jupyter_notebook_config.py'
end script
@whophil
whophil / recursive_glob.py
Last active Aug 2, 2018
Recursive glob in Python: Find all files matching a glob-style pattern. Adapted from http://stackoverflow.com/a/2186565/6191541
View recursive_glob.py
import os
import fnmatch
def recursive_glob(rootdir='.', pattern='*'):
"""Search recursively for files matching a specified pattern.
Adapted from http://stackoverflow.com/questions/2186525/use-a-glob-to-find-files-recursively-in-python
"""
matches = []
@whophil
whophil / sge-tools.sh
Last active Jan 19, 2017
Bash scripts for making life with Sun Grid Engine (SGE) easier.
View sge-tools.sh
#!/bin/sh
#
# A collection of bash functions for working with SGE.
#
# Installation
# ------------
# Install at the command prompt
# $ . /path/to/sge-goto.sh
#
# Or, add this line to your ~/.bashrc