Skip to content

Instantly share code, notes, and snippets.

View ebenolson's full-sized avatar

Eben Olson ebenolson

  • Presco Engineering
  • Woodbridge, CT
View GitHub Profile
#!/bin/bash
docker run -i ebenolson/mscomplex-tri-docker bash -c 'cat > input && mscomplex-tri-cl-tool -o input &> log && cat input.mscomplex.full.bin' < $1 > "$1.mscomplex.full.bin"
@ebenolson
ebenolson / mouser.js
Created November 30, 2018 16:26
Export MPN from Mouser order page
javascript:(function(){
function copyStringToClipboard (str) {
var el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style = {position: 'absolute', left: '-9999px'};
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
@ebenolson
ebenolson / convert_mod.py
Created January 4, 2019 21:14
KiCAD Python script to convert old .mod footprint libraries to .kicad_mod
import sys
from pcbnew import *
infile = sys.argv[1]
outdir = sys.argv[2]
inplugin = IO_MGR.PluginFind(IO_MGR.GuessPluginTypeFromLibPath(infile))
outplugin = IO_MGR.PluginFind(IO_MGR.GuessPluginTypeFromLibPath(outdir))
for name in inplugin.FootprintEnumerate(infile):
#!/bin/bash
if [ ! -f convert_mod.py ]; then
wget https://gist.github.com/ebenolson/07af5bf0919dfa7f5585577ad073c120/raw/fc15e516ff21a503833d9157f52de9334139ce7b/convert_mod.py
fi
docker run -it -v `pwd`:`pwd`:rw -w `pwd` ebenolson/kicad:5.0.0 bash -c "python convert_mod.py $1 $2"
sudo chown -R $USER $2