Skip to content

Instantly share code, notes, and snippets.

@NelsonMinar
NelsonMinar / hatch.py
Created Sep 28, 2021
Hatching algorithm (in progress)
View hatch.py
def hatch(polygon, spacing: float = 1, rotation: float = 0, tolerance: float = 5, inset: float = 0) -> shapely.geometry.MultiLineString:
"""
Fill a polygon with hatched lines.
Note this code is unit-independent. The default spacing of 1 was chosen with the idea of the units being
millimeters and the pen width being 0.5mm, for a 50% fill.
:param polygon: the shape to generate a hatch for
:param spacing: space between hatch lines
:param rotation: rotation of hatch lines (in degrees)
:param tolerance: limit on length of joining lines to make hatches a single line. Multiples of spacing.
@NelsonMinar
NelsonMinar / Torena Somnopose Oscar convertor
Last active Jul 29, 2021
Torena to Somnopose data convertor for OSCAR
View Torena Somnopose Oscar convertor
Notes:
https://nelsonslog.wordpress.com/2021/07/21/sleep-position-tracking-and-oscar/
http://www.apneaboard.com/forums/Thread-Torena-sleep-position-monitor-for-Android-similar-to-SomnoPose
View Metafilter users.opml
<opml version="1.0" xmlns:fz="urn:forumzilla:">
<head>
<title>Metafilter user blogs https://metatalk.metafilter.com/24654/Who-Are-The-Bloggers-of-Metafilter</title>
<dateCreated>Sat, 20 Jan 2018 21:49:01 GMT</dateCreated>
</head>
<body>
<outline type="rss" title="Amor Bellator" text="Amor Bellator" version="RSS" xmlUrl="https://amorbellator.com/feed/" htmlUrl="https://amorbellator.com"/>
<outline type="rss" title="Boxer Indemnity Scholars" text="Boxer Indemnity Scholars" version="RSS" xmlUrl="https://boxerindemnityscholars.wordpress.com/feed/" htmlUrl="https://boxerindemnityscholars.wordpress.com"/>
<outline type="rss" title="Best Results Organizing" text="Best Results Organizing" version="RSS" xmlUrl="http://juliebestry.com/feed/" htmlUrl="http://juliebestry.com"/>
<outline type="rss" title="mike.whybark.com" text="mike.whybark.com" version="RSS" xmlUrl="http://mike.whybark.com/feed" htmlUrl="http://mike.whybark.com"/>
@NelsonMinar
NelsonMinar / index.html
Last active Feb 10, 2018
Demo of using Mocha + Chai in a browser without Node
View index.html
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/mocha/5.0.0/mocha.css" rel="stylesheet" />
</head>
<body>
<div id="mocha"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/5.0.0/mocha.js"></script>
@NelsonMinar
NelsonMinar / idb-walk.py
Created Jan 11, 2018
IndexedDB database file walker for Firefox
View idb-walk.py
#!/usr/bin/env python3.6
"""
Hacky code to walk all the IndexedDB storage in your Firefox profile
and print some basic information about them.
The hardcoded path here works in WSL, Linux-for-Windows. Change as needed.
"""
base_dir = '/mnt/c/Users/*/AppData/Roaming/Mozilla/Firefox/Profiles/*/storage/default/'
@NelsonMinar
NelsonMinar / Sigmoid hidden layer.ipynb
Created Jan 6, 2018
TensorFlow MNIST sigmoid recognizer
View Sigmoid hidden layer.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@NelsonMinar
NelsonMinar / scrape.ipynb
Created Nov 28, 2017
Demo of using IPython with BeautifulSoup
View scrape.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View North Carolina 2014 election data by precinct.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Pandas-MultiIndex-slicing-demo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@NelsonMinar
NelsonMinar / winrates.ipynb
Created Sep 16, 2016
League of Legends win rates by tier
View winrates.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.