Data from a project analyzing League of Legends ranks in 2016.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
"Demonstrate using multiprocessing.Pool()" | |
import multiprocessing, time, logging, os, random, signal, pprint, traceback | |
logging.basicConfig(level=logging.DEBUG) | |
_L = logging.getLogger() | |
class JobTimeoutException(Exception): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
"""Demonstration of a Python logging handler that creates a separate output | |
file for each stream. The key thing here is the class MultiHandler. It picks | |
the file name based on the thread name; could use anything in threading.local() | |
""" | |
import threading, logging, time, random, os | |
# Global object we log to; the handler will work with any log message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tools for making a very simple web slippy map of Grand Theft Auto V maps. | |
By Nelson Minar <nelson@monkey.org> | |
I don't want to host this map myself because of copyright concerns. | |
No support provided for this code, just hoping it's a useful guide for | |
someone to roll their own amp. | |
maketiles.sh runs gdal2tiles.py to slice up the source image into tiles. | |
map.html is a simple Leaflet / web map. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html><head><script type="text/javascript" src="https://github.com/mbostock/d3/raw/master/d3.js"></script></head><body> | |
<script lang="text/javascript"> | |
window.onload = function() { | |
// Create a red rectangle | |
d3.select("body").append("svg:svg") | |
.attr("width", "100").attr("height", "100") | |
.append("svg:rect") | |
.attr("id", "myrectangle") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Data imports for a custom solar monitoring system I build using Sunpower's PVS6, Telegraf, Influx, and Grafana. | |
See http://nelsonslog.wordpress.com/ for details | |
This code is provided without license or support. If you do something interested and related let me know! | |
--nelson@monkey.org |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Various options for a JSON type for Python. | |
My best effort at using these libraries naturally for reading and writing JSON. | |
https://nelsonslog.wordpress.com/2016/01/08/a-better-python-object-for-json/ | |
""" | |
import json, copy | |
import dotmap, attrdict, easydict, addict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
NewerOlder