Skip to content

Instantly share code, notes, and snippets.

View benhoyle's full-sized avatar

Ben Hoyle benhoyle

View GitHub Profile
@benhoyle
benhoyle / Building AV Capture Objects.ipynb
Last active March 4, 2024 07:07
Building Audio/Video Capture Objects
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benhoyle
benhoyle / Retinal to Cortex (Polar to Cartesian) Mappings.ipynb
Created February 23, 2019 15:34
Retinal to Cortex (Polar to Cartesian) Mappings
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benhoyle
benhoyle / checkdigit.py
Created May 1, 2018 09:32
Calculate EPO Check Digit given the application number as a string
def calculate_checkdigit(appln_number):
"""Calculate EPO checkdigit."""
def digits_of(n):
return [int(d) for d in str(n)]
digits = digits_of(appln_number)
even_digits = digits[-1::-2]
odd_digits = digits[-2::-2]
checksum = 0
checksum += sum(odd_digits)
for d in even_digits:
@benhoyle
benhoyle / Gensim Testing.ipynb
Created March 11, 2017 12:36
Juptyer Notebook covering some Gensim experiments
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benhoyle
benhoyle / docker_install.sh
Last active February 14, 2017 10:24
Install Script for Docker on Ubuntu Trusty 14.04 - run with 'sudo bash docker_install.sh'
#!/bin/bash
apt-get update
apt-get install -y --no-install-recommends \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
apt-get install -y --no-install-recommends \
apt-transport-https \
@benhoyle
benhoyle / editable-react-panel.markdown
Last active November 23, 2016 13:14
Editable React Panel
@benhoyle
benhoyle / index.html
Created November 22, 2016 17:14
Person Data Panels
<body>
<div class="container-fluid" id="container">
</div>
</body>
@benhoyle
benhoyle / index.html
Last active November 20, 2016 11:41
React Table - Dynamic
<body>
<div class="container-fluid" id="container">
</div>
</body>
</html>
@benhoyle
benhoyle / index.html
Created November 17, 2016 13:15
React Table
<body>
<div class="container-fluid" id="container">
</div>
</body>
</html>
@benhoyle
benhoyle / datamodels.py
Created October 20, 2016 06:06
A quick skeleton file to create an SQLite database with SQL Alchemy
import os
from datetime import datetime
# Define name and path for SQLite3 DB
db_name = "filename.db"
db_path = os.path.join(os.getcwd(), db_name)
# Create DB
from sqlalchemy import create_engine
engine = create_engine('sqlite:///' + db_path, echo=False)