Skip to content

Instantly share code, notes, and snippets.

View davehorner's full-sized avatar

David Horner davehorner

View GitHub Profile
@davehorner
davehorner / simple.py
Created November 9, 2021 00:31 — forked from cswiercz/simple.py
A quick demonstration of how to plot multivalued complex functions in Python.
import numpy
import sympy
from mpl_toolkits.mplot3d import Axes3D
import matplotlib
from matplotlib import cm, colors
from matplotlib import pyplot as plt
branching_number = 2
@davehorner
davehorner / Convert Script – README.md
Created November 5, 2021 02:48 — forked from Zehkul/Convert Script – README.md
Script to quickly convert and crop videos from within mpv

#README:

This script for mpv intends to offer the fastest and simplest way to convert parts of a video—while you’re watching it and not really more work intensive than making a screenshot. A short demonstration: https://d.maxfile.ro/omdwzyhkoa.webm

##Installation:

You need:

  • yad (at least 0.26) (AUR)
@davehorner
davehorner / cached_factory.cpp
Created November 5, 2021 01:06 — forked from cswiercz/cached_factory.cpp
Herb Sutter's favorite sub-10 line C++ snippet: Factory w/Cache
/*
Cached Factory
Sometimes you want to make objects with a lifetime managed
by their target owner but you also want to hold reference
to them in a custom cache. The target owner, naturally, will
be given a shared_ptr to the output object. However, we don't
want the lifetime of the output object to be tied to the
internal cache. I.e. if the owner dies then the object should
die even if referenced in the cache.
@davehorner
davehorner / video_save.py
Created September 29, 2020 19:36 — forked from imamdigmi/video_save.py
TensorFlow object detection with video and save the output using OpenCV
"""
This notebook will demontrate a pre-trained model to recognition plate number in an image.
Make sure to follow the [installation instructions](https://github.com/imamdigmi/plate-number-recognition#setup) before you start.
"""
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
@davehorner
davehorner / Install-ChocoAndScoop.ps1
Created March 23, 2020 01:02 — forked from turboBasic/Install-ChocoAndScoop.ps1
Install Chocolatey and Scoop package managers for Windows + basic set of utilities and software
Function Install-Scoop {
New-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" `
-propertyType ExpandString `
-name "SCOOP_GLOBAL" `
-value "${ENV:PROGRAMDATA}\scoop"
Invoke-WebRequest 'https://get.scoop.sh' | Invoke-Expression
'scoop install Git-with-OpenSSH Sudo Which --global' | Set-Content -path temp_script.ps1
@davehorner
davehorner / stepper2.ino
Created December 8, 2015 09:10 — forked from sbright33/stepper2.ino
Stepper library for 28BYJ-48
// This Arduino example demonstrates bidirectional operation of a
// 28BYJ-48, which is readily available on eBay for $4.25 inc shipping,
// using a ULN2003 interface board to drive the stepper. The 28BYJ-48
// motor is a 4-phase, 8-beat motor, geared down by a factor of 64. One
// bipolar winding is on motor pins 1,3 and the other on motor pins 2,4.
// Refer to the manufacturer's documentation of Changzhou Fulling
// Motor Co., Ltd., among others. The step angle is 5.625/64 and the
// operating Frequency is 100pps. Current draw is 92mA.
// Vin w USB power is 4.5v too slow for testing use 5v pin.
//#include <Narcoleptic.h>