Skip to content

Instantly share code, notes, and snippets.

View michaelaye's full-sized avatar

Michael Aye michaelaye

View GitHub Profile
@michaelaye
michaelaye / conda_env_export.py
Created October 22, 2021 23:28 — forked from michael-ford/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).
@michaelaye
michaelaye / remotemd5.py
Created October 7, 2021 02:09 — forked from brianewing/remotemd5.py
Python MD5 of remote file (URL)
import os, hashlib, urllib2, optparse
def get_remote_md5_sum(url, max_file_size=100*1024*1024):
remote = urllib2.urlopen(url)
hash = hashlib.md5()
total_read = 0
while True:
data = remote.read(4096)
total_read += 4096
@michaelaye
michaelaye / advanced_rasterio_features.ipynb
Created October 24, 2020 01:34 — forked from sgillies/advanced_rasterio_features.ipynb
Advanced Rasterio features notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@michaelaye
michaelaye / gitconfig.ini
Created June 9, 2020 17:04 — forked from tdd/gitconfig.ini
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = your@email.tld
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
.ipynb_checkpoints
@michaelaye
michaelaye / raytracing.py
Created March 14, 2019 04:23 — forked from rossant/raytracing.py
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@michaelaye
michaelaye / raytracing.py
Created December 30, 2016 20:03 — forked from sklam/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
<?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>
{
"metadata": {
"name": "",
"signature": "sha256:2671bcf8ad936f12851c3856c8114fbd59a36e08903b1337ca903c79059900fd"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
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,
)