Skip to content

Instantly share code, notes, and snippets.

View nathan-sixnines's full-sized avatar

Nathan Epstein nathan-sixnines

View GitHub Profile
import sys
import string
import matplotlib.dates as mdates
#lines, warnings, errors
timeBuckets = [[],[],[]]
hoursList = []
@nathan-sixnines
nathan-sixnines / shapecutter.py
Last active June 18, 2019 23:38
Functions to assist using shapely and ezdzf
# Draws shape to modelspace
def drawShape(shape,msp):
if(shape.type == 'Polygon'):
drawLineRing(shape.exterior,msp)
for linering in shape.interiors:
import math
import numpy as np
# very simple discrete "convolution" of 1D filter [1,1,0] over input B
# example: input: 00010
# output: 00110
# input: 01110
# output: 12210
def convoleBasic(a,b):
@nathan-sixnines
nathan-sixnines / nginx.conf
Created July 12, 2018 20:46
nginx.conf for local + broadcast
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@nathan-sixnines
nathan-sixnines / padfunc.html
Created May 14, 2018 22:48
array padding function
<script src="https://cdn.jsdelivr.net/gh/nicolaspanel/numjs@0.15.1/dist/numjs.min.js"></script>
<script>
function modularPaddArray(prePadArray, border){ // buffer should be input tile radius
var ppa = prePadArray
var b = border
// 9 parts, original array in center, 4 sides, 4 corners
@nathan-sixnines
nathan-sixnines / germ_game_onearray_working.html
Created August 30, 2017 19:25
germ game onearray working
<!DOCTYPE html>
<html>
<body>
<div id="container">
<canvas id="myCanvas" width= 450%; height= 450%; style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<canvas id="myCanvas2" width= 450%; height= 450%; style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
@nathan-sixnines
nathan-sixnines / germ_game_onearray.html
Created August 30, 2017 15:47
Go life onearray refactor
<!DOCTYPE html>
<html>
<body>
<div id="container">
<canvas id="myCanvas" width= 450%; height= 450%; style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<canvas id="myCanvas2" width= 450%; height= 450%; style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
@nathan-sixnines
nathan-sixnines / germ_game_onearray.html
Created August 30, 2017 15:47
Go life onearray refactor
<!DOCTYPE html>
<html>
<body>
<div id="container">
<canvas id="myCanvas" width= 450%; height= 450%; style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<canvas id="myCanvas2" width= 450%; height= 450%; style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
@nathan-sixnines
nathan-sixnines / germ_game.html
Created August 29, 2017 15:05
Germ (Go + Life)
<!DOCTYPE html>
<html>
<body>
<div id="container">
<canvas id="myCanvas" width= 950%; height= 950%; style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
</div>
<script>
<!DOCTYPE html>
<html>
<body>
<div id="container">
<canvas id="myCanvas" width= 950%; height= 950%; style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
</div>
<script>