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 math | |
def format_eng(number, places=2, force_exponent=None, use_si=False, use_unicode=False, use_latex=False, return_components=False, strip_zeros=True, unit=None, pos_sign=False): | |
si_lookup = { | |
24: 'Y', 21: 'Z', | |
18: 'E', 15: 'P', 12: 'T', | |
9: 'G', 6: 'M', 3: 'k', | |
-3: 'm', -6: 'μ', -9: 'n', | |
-12: 'p', -15: 'f', -18: 'a', | |
-21: 'z', -24: 'y', |
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
// ==UserScript== | |
// @name Ebay Blacklist | |
// @namespace https://www.cgtk.co.uk | |
// @version 0.1 | |
// @description Make it clear when ebay sellers are on a blacklist | |
// @author A. Budden | |
// @match https://*.ebay.co.uk/itm/* | |
// @icon https://www.google.com/s2/favicons?domain=ebay.co.uk | |
// @grant none | |
// ==/UserScript== |
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
FROM ubuntu:18.04 | |
RUN dpkg-divert --local --rename --add /sbin/initctl | |
RUN ln -sf /bin/true /sbin/initctl | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN dpkg --add-architecture i386 && \ | |
apt-get update && \ | |
apt-get -y install \ | |
make \ |
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
#!/usr/bin/python3 | |
# vim: set fileencoding=utf-8 : | |
import itertools | |
import cadquery as cq | |
def exportStep(object_list, filename): | |
""" | |
Simple worker function to take a list of objects and export a single step file with all objects in place. | |
""" | |
vals = list(itertools.chain(*[o.vals() for obj in object_list for o in obj.all()])) |
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
#!/usr/bin/python3 | |
# vim: set fileencoding=utf-8 : | |
import itertools | |
import cadquery as cq | |
def exportStep(object_list, filename): | |
""" | |
Simple worker function to take a list of objects and export a single step file with all objects in place. | |
""" | |
vals = list(itertools.chain(*[o.vals() for obj in object_list for o in obj.all()])) |