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
/* | |
Copyright (c) 2013, Ilan Schnell, Continuum Analytics, Inc. | |
Python bindings to picosat (http://fmv.jku.at/picosat/) | |
This file is published under the same license as picosat itself, which | |
uses an MIT style license. | |
*/ | |
#define PYCOSAT_URL "https://pypi.python.org/pypi/pycosat" | |
#include <Python.h> | |
#include "structmember.h" |
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
# most of the following code is from here: https://github.com/WoLpH/numpy-stl#combining-multiple-stl-files | |
# but instead of combining STLs, I'm just copying and replicating the same one | |
import math | |
import stl | |
from stl import mesh | |
import numpy | |
# find the max dimensions, so we can know the bounding box, getting the height, width, length (because these are the step size)... | |
def find_mins_maxs(obj): |
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
import numpy as np | |
import cv2 | |
import math | |
h=1000 | |
w=1000 | |
scaling = 20. | |
fin_w = 85 |
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
""" | |
Renames KiCad plot and drill files to the correct OSHpark file extensions, and also puts all these into a ZIP file. | |
usage: | |
python rename_kicad_gerbers.py path/to/my/project/plot_output | |
returns: | |
kicad_out.zip (in the directory you ran the script from) | |
""" | |
import os |
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
import xlrd | |
import sys | |
if __name__ == '__main__': | |
if len(sys.argv) != 2: | |
print "Usage: git-xlsx-textconv file.xslx" | |
excelFileName = sys.argv[1] | |
xlFile = xlrd.open_workbook(excelFileName) |
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
""" | |
A super-simple GUI for setting my laptop backlight. | |
For some reason Ubuntu Answers couldn't tell me where to change the minimum brightness and step interval. | |
So I had to make something because my laptop can be MUCH dimmer than Ubuntu's minimum. | |
Added this version for tk, since it is such a simple GUI. | |
""" | |
import os | |
import subprocess | |
from Tkinter import * |
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
function copyToClipboard (text) { | |
window.prompt ("Copy to clipboard: Ctrl+C, Enter", text); | |
} | |
var xhr = new XMLHttpRequest(); | |
xhr.onload = function(e) { | |
if (this.status == 200) { | |
var xhr2 = new XMLHttpRequest(); | |
xhr2.onreadystatechange = function() { | |
switch (xhr2.readyState) { | |
case 0: // uninitialized |
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
var testUrl = 'http://link.springer.com.ezproxy.rit.edu/content/pdf/10.1007/s11207-013-0286-8.pdf'; | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", window.location, false); | |
xhr.send(null); | |
function crossDomainPost() { | |
// Add the iframe with a unique name | |
var iframe = document.createElement("iframe"); | |
var uniqueString = "CHANGE_THIS_TO_SOME_UNIQUE_STRING"; | |
document.body.appendChild(iframe); |
NewerOlder