Skip to content

Instantly share code, notes, and snippets.

View pbfy0's full-sized avatar

Paul Fisher-York pbfy0

  • Ithaca, NY
View GitHub Profile
static const uint8_t sin_table[] = {
0, 1, 3, 4, 6, 7, 9, 10, 12, 14, 15, 17, 18,
20, 21, 23, 25, 26, 28, 29, 31, 32, 34, 36, 37, 39,
40, 42, 43, 45, 46, 48, 49, 51, 53, 54, 56, 57, 59,
60, 62, 63, 65, 66, 68, 69, 71, 72, 74, 75, 77, 78,
80, 81, 83, 84, 86, 87, 89, 90, 92, 93, 95, 96, 97,
99, 100, 102, 103, 105, 106, 108, 109, 110, 112, 113, 115, 116,
117, 119, 120, 122, 123, 124, 126, 127, 128, 130, 131, 132, 134,
135, 136, 138, 139, 140, 142, 143, 144, 146, 147, 148, 149, 151,
152, 153, 155, 156, 157, 158, 159, 161, 162, 163, 164, 166, 167,
import sys
import os
import argparse
import json
from datetime import datetime
from operator import attrgetter
def unicode_print(s):
print((str(s).encode('utf8')))
$ghostscript = "C:\Program Files\gs\gs9.22\bin\gswin64c.exe"
$sumatrapdf = "C:\Program Files\SumatraPDF\SumatraPDF.exe"
$filename = $args[0]
if($filename.EndsWith("_gs.pdf")) {
Start-Process $sumatrapdf -ArgumentList $filename
exit
}
$nfn = $filename -replace "\.pdf$","_gs.pdf"
if(Test-Path $nfn -PathType leaf) {
$orig_mt = (Get-Item $filename).LastWriteTime
import serial
import sys
import code
import select
import binascii
import time
import reedsolo
s = serial.Serial(baudrate=115200)#, rtscts=True)
s.dtr = True
s.port = sys.argv[1]
import serial
import sys
import code
import select
import binascii
import time
s = serial.Serial(baudrate=115200)#, rtscts=True)
s.dtr = True
s.port = sys.argv[1]
s.open()
import serial
import sys
import code
import select
s = serial.Serial(baudrate=115200, rtscts=True)
s.dtr = True
s.port = sys.argv[1]
s.open()
s.write(b'\xff\x02\xfe\x4e')
@pbfy0
pbfy0 / weightview.py
Created February 8, 2018 04:38
Colorize objects in inventor by weight/density
import win32com
import pywintypes
import math
win32com.__gen_path__ = r'C:\Users\Paul\Documents\gen_py'
import win32com.client as cc
app = cc.gencache.EnsureDispatch('Inventor.Application')
import ssl
import socket
import selectors
sel = selectors.DefaultSelector()
REM_ADDR = ('domain', 4433)
mm = {}
import numpy as np
import ctypes
import math
import scipy.misc
import scipy.integrate
import itertools
import random
import functools
import sys
import argparse
/**
* @fileoverview gl-matrix - High performance matrix and vector operations
* @author Brandon Jones
* @author Colin MacKenzie IV
* @version 2.4.0
*/
/* Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.
Permission is hereby granted, free of charge, to any person obtaining a copy