Skip to content

Instantly share code, notes, and snippets.

View michaelaye's full-sized avatar

Michael Aye michaelaye

View GitHub Profile
@jgarber
jgarber / private.xml
Created August 28, 2012 01:59
KeyRemap4MacBook setup to pair program with one Dvorak - Qwerty ⌘ typist and one Qwerty typist
<?xml version="1.0"?>
<root>
<deviceproductdef>
<productname>APPLE_INTERNAL_KEYBOARD_TRACKPAD_0x024c</productname>
<productid>0x024c</productid>
</deviceproductdef>
<deviceproductdef>
<productname>APPLE_WIRELESS_KEYBOARD_0x22c</productname>
<productid>0x22c</productid>
</deviceproductdef>
@Jim-Holmstroem
Jim-Holmstroem / gist:3705378
Created September 12, 2012 08:56
Highlight a span on a timeseries plot using pandas and matplotlib
def render_split(time, color, offset = -4*pd.datetools.Minute(15)):
if(color is not None):
pl.gca().axvspan(
time + offset,
time + pd.datetools.Minute(15) + offset,
facecolor = pl.cm.Paired( float(color % 12)/12 ),
linewidth = 0,
alpha = 1.0,
)
@asmeurer
asmeurer / raytracing.py
Last active December 30, 2016 20:04 — forked from rossant/raytracing.py
import numpy as np
import matplotlib.pyplot as plt
w = 400
h = 300
from numba import autojit
@autojit
def normalize(x):
@sklam
sklam / raytracing.py
Last active May 25, 2021 05:14 — forked from rossant/raytracing.py
Numba optimized raytracing. From 23seconds to 9seconds.
from __future__ import print_function, division
from timeit import default_timer as timer
import numpy as np
import matplotlib.pyplot as plt
from numba import njit
w = 400
h = 300

#LaTeX in IPython Notebook

With this extension you can use LaTeX-style references within IPython (Notebook) while still using markdown for formatting.

Required:

  • ipython-dev
  • biblio-py
  • markdown
@hugorodgerbrown
hugorodgerbrown / md_to_rst.sh
Last active March 26, 2023 16:57
Shell script for converting a batch of *.md files into *.rst using pandoc.
# This script was created to convert a directory full
# of markdown files into rst equivalents. It uses
# pandoc to do the conversion.
#
# 1. Install pandoc from http://johnmacfarlane.net/pandoc/
# 2. Copy this script into the directory containing the .md files
# 3. Ensure that the script has execute permissions
# 4. Run the script
#
# By default this will keep the original .md file
@glass5er
glass5er / pptximage.py
Last active May 25, 2023 13:08
add an image in every Powerpoint slide using python-pptx
##
## Copy & Paste Tool for images to PowerPoint(.pptx)
##
import pptx
import pptx.util
import glob
import scipy.misc
OUTPUT_TAG = "MY_TAG"
@michael-ford
michael-ford / conda_env_export.py
Created March 3, 2021 21:46 — forked from gwerbin/conda_env_export.py
Export a Conda environment with --from-history, but also append Pip-installed dependencies
"""
Export a Conda environment with --from-history, but also append
Pip-installed dependencies
Exports only manually-installed dependencies, excluding build versions, but
including Pip-installed dependencies.
Lots of issues requesting this functionality in the Conda issue tracker, no
sign of progress (as of March 2020).
@kogakure
kogakure / .gitignore
Last active December 17, 2023 08:21
Git: .gitignore file for LaTeX projects
*.acn
*.acr
*.alg
*.aux
*.bak
*.bbl
*.bcf
*.blg
*.brf
*.bst
@milancermak
milancermak / pre-commit.sh
Created October 7, 2012 19:24
Python pre-commit hook
#!/bin/sh
# make sure requirements.txt is up to date with every commit
# by comparing the output of pip freeze
pip freeze | diff requirements.txt - > /dev/null
if [ $? != 0 ]
then
echo "Missing python module dependencies in requirements.txt. Run 'pip freeze > requirements.txt' to update."
exit 1
fi