Skip to content

Instantly share code, notes, and snippets.

@magsol
magsol / OpenCV Introduction.ipynb
Created December 2, 2013 20:14
IPython notebook introducing the basics of OpenCV.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@magsol
magsol / gist:f2961e0c8bfeee56339973773c8b6d8a
Last active August 5, 2020 16:37
ffmpeg video format conversion
# converts vidfile.avi to vidfile.mov
# re-encodes video using h264 codec
# This is good for, e.g., creating a video to post to instagram.
ffmpeg -i vidfile.avi -c:v h264 vidfile.mov
# This is good for, e.g., creating a video to embed in PPTX.
ffmpeg -i vidfile.avi -pix_fmt yuv420p vidfile.mov
# see the list of available codecs
@magsol
magsol / gist:eba6c40b33eb6cd31be8627cdc18d6b4
Last active September 1, 2020 19:43
Initial setup and configuration of the Kubernetes cluster
@magsol
magsol / histogram_equalization_in_python.ipynb
Created September 19, 2013 18:47
IPython notebook about histogram equalization with images. Basic image processing.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@magsol
magsol / running_mileage.py
Created October 4, 2023 14:43
Monthly running mileage plot
# coding: utf-8
import numpy as np
import matplotlib.pyplot as plt
# Dates (by month: October 2019 through September 2023)
dates = ['Oct19', 'Nov19', 'Dec19', 'Jan20', 'Feb20', 'Mar20', 'Apr20', 'May20', 'Jun20', 'Jul20', 'Aug20', 'Sep20', 'Oct20', 'Nov20', 'Dec20', 'Jan21', 'Feb21', 'Mar21', 'Apr21', 'May21', 'Jun21', 'Jul21', 'Aug21', 'Sep21', 'Oct21', 'Nov21', 'Dec21', 'Jan22', 'Feb22', 'Mar22', 'Apr22', 'May22', 'Jun22', 'Jul22', 'Aug22', 'Sep22', 'Oct22', 'Nov22', 'Dec22', 'Jan23', 'Feb23', 'Mar23', 'Apr23', 'May23', 'Jun23', 'Jul23', 'Aug23', 'Sep23']
# Mileages (per month)
mileages = [153.49, 100.30, 101.19, 80.82, 139.45, 125.23, 101.14, 97.93, 82.42, 49.97, 0.0, 0.0, 23.76, 8.41, 5.68, 33.96, 14.08, 17.80, 30.97, 40.24, 16.40, 29.37, 23.41, 30.10, 35.08, 18.06, 18.79, 52.87, 33.71, 58.27, 21.67, 25.81, 14.68, 16.24, 38.55, 41.04, 50.35, 8.96, 15.77, 14.19, 48.73, 64.55, 73.92, 63.36, 60.10, 62.67, 85.22, 101.28]