Skip to content

Instantly share code, notes, and snippets.

View nathan-sixnines's full-sized avatar

Nathan Epstein nathan-sixnines

View GitHub Profile
@nathan-sixnines
nathan-sixnines / gnugo_vs_gnugo.py
Created April 14, 2017 17:03
modified gnugo_vs_gnugo from https://github.com/jtauber/gtp/ to review games with Leela
#!/usr/bin/env python
from subprocess import Popen, PIPE, STDOUT
import string
import thread
from threading import Timer
from gtp import parse_vertex, gtp_move, gtp_color
from gtp import BLACK, WHITE, PASS
import sgf
from PIL import Image
im = Image.open('Flag_of_Maryland.svg.png')
left = Image.open('flag_left.png')
right = Image.open('flag_right.png')
count = 0
dimensions = im.size
import sys
import os
def pdf_to_csv(filename):
from cStringIO import StringIO
from pdfminer.converter import LTChar, TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfparser import PDFDocument, PDFParser
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
<!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>
@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>
@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_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 / 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 / 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;