Skip to content

Instantly share code, notes, and snippets.

View Erhannis's full-sized avatar

Erhannis

View GitHub Profile
@Erhannis
Erhannis / jlcpcb_copy_raw.js
Created October 16, 2023 13:02
Copy JLCPCB/LCSC part info into format you can paste into a raw KiCAD file directly (for easier mass update via e.g. find/replace)
a1 = document.evaluate("//dl[contains(., 'MFR.Part #')]", document, null, XPathResult.ANY_TYPE, null );
a2 = a1.iterateNext();
if (a2 == null) {
a1 = document.evaluate("//tr[contains(., 'Mfr. Part #')]", document, null, XPathResult.ANY_TYPE, null );
a2 = a1.iterateNext();
}
b1 = document.evaluate("//dl[contains(., 'JLCPCB Part #')]", document, null, XPathResult.ANY_TYPE, null );
b2 = b1.iterateNext();
@Erhannis
Erhannis / jlcpcb_copy.js
Last active August 16, 2023 23:34
Copy JLCPCB/LCSC part info into format you can paste into KiCAD part info 4 rows
/*
// Bookmarklet
javascript:a1%20%3D%20document.evaluate%28%22%2F%2Fdl%5Bcontains%28.%2C%20%27MFR.Part%20%23%27%29%5D%22%2C%20document%2C%20null%2C%20XPathResult.ANY_TYPE%2C%20null%20%29%3B%0Aa2%20%3D%20a1.iterateNext%28%29%3B%0A%0Aif%20%28a2%20%3D%3D%20null%29%20%7B%0A%20%20a1%20%3D%20document.evaluate%28%22%2F%2Ftr%5Bcontains%28.%2C%20%27Mfr.%20Part%20%23%27%29%5D%22%2C%20document%2C%20null%2C%20XPathResult.ANY_TYPE%2C%20null%20%29%3B%0A%20%20a2%20%3D%20a1.iterateNext%28%29%3B%0A%7D%0A%0Ab1%20%3D%20document.evaluate%28%22%2F%2Fdl%5Bcontains%28.%2C%20%27JLCPCB%20Part%20%23%27%29%5D%22%2C%20document%2C%20null%2C%20XPathResult.ANY_TYPE%2C%20null%20%29%3B%0Ab2%20%3D%20b1.iterateNext%28%29%3B%0A%0Aif%20%28b2%20%3D%3D%20null%29%20%7B%0A%20%20b1%20%3D%20document.evaluate%28%22%2F%2Ftr%5Bcontains%28.%2C%20%27LCSC%20Part%20%23%27%29%5D%22%2C%20document%2C%20null%2C%20XPathResult.ANY_TYPE%2C%20null%20%29%3B%0A%20%20b2%20%3D%20b1.iterateNext%28%29%3B%0A%7D%0A%0Ac1%20%3D%20document.evaluate%28%22%2F%2Fdl%5Bcontains%2
@Erhannis
Erhannis / useful.txt
Last active August 2, 2018 11:59
Useful snippets and commands
## Git
git symbolic-ref HEAD refs/heads/<BRANCH_NAME>
@Erhannis
Erhannis / LICENSE
Last active January 21, 2022 12:09 — forked from madc/LICENSE
Simple morse en- & decoding for Arduino (including LED Example)Build after the specs on http://en.wikipedia.org/wiki/Morse_code
Copyright (c) 2015 Matthias Esterl
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Erhannis
Erhannis / CutCircularArc.json
Created February 3, 2016 06:26 — forked from o8ruza8o/CutCircularArc.json
Plethora Add-In Technical Exercise
{
"Edges": {
"53330552": {
"Type": "LineSegment",
"Vertices": [
10212927,
43495525
]
},
"24807479": {