This file contains hidden or 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
| '''conversion functions | |
| ''' | |
| from math import (sqrt, pi, floor, log10) | |
| def powerise10(value): | |
| """ Returns value as a * 10 ^ b with 0<= a <10 | |
| """ | |
| if value == 0: return 0 , 0 | |
| _neg = value <0 |
This file contains hidden or 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
| #include <Arduino.h> | |
| class Max14871 { | |
| public: | |
| Max14871(uint8_t pwm_pin, uint8_t dir_pin); | |
| void init(unsigned int pwm_freq); | |
| void set_duty_cycle(float duty); | |
| void set_speed(float speed); | |
| void enable(void); | |
| void disable(void); |
This file contains hidden or 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
| /** | |
| * @file: iir-filters.hpp | |
| * @name: Luke Gary | |
| * @company: <company> | |
| * @date: 2021/3/19 | |
| ******************************************************************************** | |
| * @copyright | |
| * Copyright 2020 <company> as an unpublished work. | |
| * All Rights Reserved. | |
| * |
This file contains hidden or 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
| [MASTER] | |
| # A comma-separated list of package or module names from where C extensions may | |
| # be loaded. Extensions are loading into the active Python interpreter and may | |
| # run arbitrary code. | |
| extension-pkg-whitelist=PyQt5 | |
| fail-under=9.5 | |
| ignore=CVS | |
| ignore-patterns= | |
| jobs=0 # let pylint use as many cores as it wants |
This file contains hidden or 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/env python | |
| # python 3 | |
| ## @file: GenerateDoxyFileBlock.py | |
| # @name: Luke Gary | |
| # @company: <company> | |
| # @date: 2020/2/20 | |
| #################################################################################################### | |
| # @copyright | |
| # Copyright <year> <company> as an unpublished work. | |
| # All Rights Reserved. |
This file contains hidden or 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/env python | |
| # python 3 | |
| # pylint: disable= | |
| ## @file: CodeTemplate.py | |
| # @name: {author name} | |
| # @company: {company name} | |
| # @date: 2020/8/21 | |
| #################################################################################################### | |
| # @copyright | |
| # Copyright 2020 {company name} as an unpublished work. |
This file contains hidden or 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 pylibdmtx.pylibdmtx import encode | |
| from PIL import Image | |
| import sys | |
| encoded = encode(sys.argv[1].encode('utf-8')) | |
| img = Image.frombytes('RGB', (encoded.width, encoded.height), encoded.pixels) | |
| img.save(sys.argv[2]) | |
| # for inserting to dymo template |
This file contains hidden or 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 sqlalchemy.orm.session import Session | |
| class QueryBuilder: | |
| """ | |
| This class describes a query builer. | |
| """ | |
| q_debug = False | |
| def query_from_dict(self, db_session: Session, **q_params): | |
| """ |
This file contains hidden or 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 os import environ | |
| from jira import JIRA | |
| import pprint as pp | |
| # need to create an API Token via Atlassian Account Mgmt | |
| # store as env variable on machine | |
| username = '<user@email_url.gfy>' | |
| api_token = environ.get('JIRA_API_TOKEN') | |
| options = {'server': 'https://<company>.atlassian.net'} | |
| # actually connect via https and API Token based authentication | |
| jira = JIRA(options, basic_auth=(user, api_token)) |
This file contains hidden or 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
| ######## CUSTOM EXCEPTION ######## | |
| class Test(Exception): | |
| def __init__(self, *args): | |
| print(*args) | |
| super().__init__(*args) | |
| >>> raise Test() | |
| #Traceback (most recent call last): | |
| # File "<stdin>", line 1, in <module> | |
| #__main__.Test |