Skip to content

Instantly share code, notes, and snippets.

View raquo's full-sized avatar

Nikita Gazarov raquo

View GitHub Profile

Keybase proof

I hereby claim:

  • I am raquo on github.
  • I am raquo (https://keybase.io/raquo) on keybase.
  • I have a public key whose fingerprint is 1D04 0FE5 383B ED39 332F 4E14 1BD3 509E 527F 9CFE

To claim this, I am signing this object:

@raquo
raquo / html-editors.md
Created April 23, 2019 06:42 — forked from manigandham/rich-text-html-editors.md
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

  • ProseMirror - http://prosemirror.net - supports collaborative editing, offers similar options to Mobiledoc for data structure

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@raquo
raquo / gist:208783abe53607a0ba52eb7bdd640d58
Last active December 31, 2021 03:23
APD telemetry parser notes - adjustments for 32 bit platform
# APD provides example telemetry parsing code, which assumes 16-bit architecture:
# See https://docs.powerdrives.net/products/hv_pro/uart-telemetry-output
#
# Below is the adjustment I had to make to their python code to properly parse current,
# which is encoded in a 16-bit integer in the message buffer
# (on my platform integers are 32 bits, which produced incorrect values out of the box)
def parseUartMessage(fullMessageBuffer: array[int]): # input is a full UART message encoded as array of bytes
# ...
# Name Version Build Channel
alabaster 0.7.12 py_0 conda-forge
applaunchservices 0.2.1 py_0 conda-forge
appnope 0.1.2 py38h50d1736_2 conda-forge
argh 0.26.2 pyh9f0ad1d_1002 conda-forge
astroid 2.9.3 py38h50d1736_0 conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
atomicwrites 1.4.0 pyh9f0ad1d_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
autopep8 1.5.6 pyhd8ed1ab_0 conda-forge
# Name Version Build Channel
alabaster 0.7.12 py_0 conda-forge
appnope 0.1.2 py37hf985489_2 conda-forge
astroid 2.9.3 py37hf985489_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
babel 2.9.1 pyh44b312d_0 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
bleach 4.1.0 pyhd8ed1ab_0 conda-forge
# Name Version Build Channel
alabaster 0.7.12 py_0 conda-forge
applaunchservices 0.2.1 py_0 conda-forge
appnope 0.1.2 py39h6e9494a_2 conda-forge
argh 0.26.2 pyh9f0ad1d_1002 conda-forge
astroid 2.9.3 py39h6e9494a_0 conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
atomicwrites 1.4.0 pyh9f0ad1d_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
autopep8 1.5.6 pyhd8ed1ab_0 conda-forge
(base) ➜ ~ python
Python 3.9.5 (default, May 18 2021, 12:31:01)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from cq_editor.widgets.editor import Editor
>>> dir(Editor)
['AdjustIgnored', 'AdjustToContents', 'AdjustToContentsOnFirstShow', 'BRACE_MATCHING_SCOPE', 'Box', 'DrawChildren', 'DrawWindowBackground', 'EXTENSIONS', 'HLine', 'IgnoreMask', 'LANGUAGES', 'LineWrapMode', 'NoFrame', 'NoWrap', 'PaintDeviceMetric', 'Panel', 'PdmDepth', 'PdmDevicePixelRatio', 'PdmDevicePixelRatioScaled', 'PdmDpiX', 'PdmDpiY', 'PdmHeight', 'PdmHeightMM', 'PdmNumColors', 'PdmPhysicalDpiX', 'PdmPhysicalDpiY', 'PdmWidth', 'PdmWidthMM', 'Plain', 'Raised', 'RenderFlag', 'RenderFlags', 'SYNC_SYMBOLS_AND_FOLDING_TIMEOUT', 'Shadow', 'Shadow_Mask', 'Shape', 'Shape_Mask', 'SizeAdjustPolicy', 'StyleMask', 'StyledPanel', 'Sunken', 'TAB_ALWAYS_INDENTS', 'UPDATE_DECORATIONS_TIMEOUT', 'VLine', 'WidgetWidth', 'WinPanel', '_BaseEditMixin__move_cursor_anchor', '_BaseEditMix
[2022-01-27 03:41:22.598284] ERROR: CQ-Editor: Uncaught exception occurred
Traceback (most recent call last):
File "/Users/raquo/opt/miniconda3/lib/python3.9/site-packages/cq_editor/widgets/editor.py", line 153, in open
self.load_from_file(fname)
File "/Users/raquo/opt/miniconda3/lib/python3.9/site-packages/cq_editor/widgets/editor.py", line 157, in load_from_file
self.set_text_from_file(fname)
File "/Users/raquo/opt/miniconda3/lib/python3.9/site-packages/spyder/plugins/editor/widgets/codeeditor.py", line 2780, in set_text_from_file
self.filename = filename
File "/Users/raquo/opt/miniconda3/lib/python3.9/site-packages/cq_editor/widgets/editor.py", line 206, in filename
self._update_filewatcher()
@raquo
raquo / workplanePatch.py
Created February 9, 2022 10:08
Patch CadQuery's workplane() method to align resulting workplane's XY plane with that of the provided xyBase
from __future__ import annotations
import math
from typing import Literal, Optional
from cadquery import cq, Workplane, Plane
from cadquery.cq import VectorLike
if not hasattr(Workplane, 'originalWorkplaneMethod'):
Workplane.originalWorkplaneMethod = Workplane.workplane