Skip to content

Instantly share code, notes, and snippets.

View feerrenrut's full-sized avatar

Reef Turner feerrenrut

  • Perth, Western Australia
  • 05:17 (UTC +08:00)
View GitHub Profile
@feerrenrut
feerrenrut / example-collapsable_log_comment.md
Created September 22, 2020 12:34
Collapsable Log GitHub comment

Use details with pre and code:

<details><summary>Insert summary here
</summary><pre><code>
A multi-line
Log message
Here
</code></pre></details>
@feerrenrut
feerrenrut / test.py
Created October 16, 2019 11:09
Test cases for NVDA code style linting
myID_1 = "foo"
myID_2 = "bar"
underIndentDict = {
myID_1: "hello", # noqa: ET122 # Unexpected number of tabs at start of expression line (expected 1, got 0)
myID_2: "world", # noqa: ET122 # Unexpected number of tabs at start of expression line (expected 1, got 0)
}
@feerrenrut
feerrenrut / testWxPythonCheckListCtrl.py
Created August 14, 2018 06:09
Compare check mark of `CheckListCtrlMixin` with `CheckListBox` when using wxPython 4.03 on Windows 10
withSetProcessDpiAware = False
import ctypes
if withSetProcessDpiAware:
ctypes.windll.user32.SetProcessDPIAware()
import wx
from wx.lib.mixins.listctrl import CheckListCtrlMixin
class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin):
@feerrenrut
feerrenrut / testSpeedUnicodeCharacterLookup.py
Last active February 7, 2018 05:30
Hacky script to test various approaches to this discussion: https://github.com/nvaccess/nvda/pull/7629#discussion_r159367500
import bisect
import unicodeScriptData
scriptCode = unicodeScriptData.scriptRanges
unicodeScriptRangeEnd = [ k[1] for k in scriptCode]
def withBisect(chr):
# Based on the following assumptions:
@feerrenrut
feerrenrut / brailleViewer.py
Last active May 26, 2020 07:57
A braille display driver for NVDA. Braille is displayed on screen. Save this file to the 'brailleDisplayDrivers' folder in your user config (`%appdata%/nvda/brailleDisplayDrivers`) directory or in `source\brailleDisplayDrivers\` directory in your repository.
#brailleViewer.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2017 NV Access Limited
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import wx
import gui
import braille
@feerrenrut
feerrenrut / drawBitmap.h
Created September 9, 2015 12:25
Draw Bitmap Piccolino
/* Draws a bitmap at the specified location
** x is horizontal distance from the left of the screen to the left of the image
** y is virtical distance from the top of the screen to the top of the image
** bitmap is a pointer to the start of the image data
** w is the width in pixels of the image
** h is the height in pixels of the image
*
** remarks: the image data contains pixels represented with a single bit. 1 representing white pixels.
** 8 pixels are expected per byte and the data is interpreted horizontally (each byte represents
** 8 horizontal pixels) thus the width of the image must be a multiple of 8.