Skip to content

Instantly share code, notes, and snippets.

<i class="icon fas fa-align-center" aria-hidden="true"></i>
<i class="icon fas fa-strikethrough" aria-hidden="true"></i>
<i class="icon fas fa-bug" aria-hidden="true"></i>
<i class="icon fab fa-git" aria-hidden="true"></i>
<i class="fa fa-video-camera" aria-hidden="true"></i>
@luzpaz
luzpaz / American2British-dictionary.txt
Last active February 16, 2018 15:38
Codespell America to British dictionary
artifact->artefact
artifacts->artefacts
behavior->behaviour
cancelation->cancellation
canceling->cancelling
canceled->cancelled
capitalize->capitalise
catalog->catalogue
centimeter->centimetre
centralize->centralise
@luzpaz
luzpaz / british2american-dictionary.txt
Last active February 16, 2018 15:37
Codespell British to English
artefact->artifact
artefacts->artifacts
behaviour->behavior
cancellation->cancelation
cancelling->canceling
cancelled->canceled
capitalise->capitalize
catalogue->catalog
centimetre->centimeter
centralise->centralize
1st Part: Download QGIS and regex it
QGIS https://raw.githubusercontent.com/qgis/QGIS/master/scripts/spell_check/spelling.dat
Remove lines that are commented out
Example:
# append :* to avoid in word check_spelling
# append :% to exclude script files
#...:…:%
Solution:
'^#.*$\n'
@luzpaz
luzpaz / Codespell-1-line-tests.txt
Last active July 30, 2021 14:39
Codespell Tips
Find a line that doesn't have '->' in it: ^(.(?!(->)))*$
Find a line with missing commas: ^(?=\w+->(?!\w+$)(?:\w+, )*\w+(?!,)$).+
# Copying commits from other repos
## This will print the diff,
## then grep all lines that start with '+' and a letter or number (needs other conditions as well
## the truncates the '+' of the beginning of the result
## copies everything to the buffer
git show | grep '^+[a-zA-Z0-9]' | cut -c 2- | pbcopy
@luzpaz
luzpaz / spellcheck_code.sh
Last active July 14, 2019 08:02
Bash script to invoke codespell on newly submitted PRs. Results will not interrupt build process but instead will be sent to the PR comment thread.
#!/bin/bash
# Inspired from https://blog.eleven-labs.com/en/how-to-check-the-spelling-of-your-docs-from-travis-ci/
# Tips:
# 1. use "exit 0;" to not interrupt build process
# 2. Needs a token as an ENV variable that is hidden (DONE: $GH_TOKEN)
# 3. requires apt package: codespell (we want to install the most up to date codespell)
# pip install --user --upgrade git+https://github.com/lucasdemarchi/codespell.git
RED='\033[0;31m'
GREEN='\033[0;32m'
@luzpaz
luzpaz / gist:3a2ae513c53c157d9b7008fe025e8895
Last active October 13, 2017 10:02
Test codespell on FreeCAD
# Install codespell
# skip this if already installed
pip3 install --user --upgrade git+https://github.com/lucasdemarchi/codespell.git
# Clone the FC repo
# skip if already cloned
git clone http://github.com/FreeCAD/FreeCAD
# Download the FC codespell whitelisted words
curl -O https://gist.githubusercontent.com/luzpaz/7ac1bf4412b9c1e5acde715ef9cb612c/raw/fc-word-whitelist.txt
@luzpaz
luzpaz / gist:1f431796dfd5c2df13e15426255cb67f
Created July 21, 2017 08:17
Abdullah describing the perspective of a dev appreciating good bug documentation
https://forum.freecadweb.org/viewtopic.php?p=183255#p183255
IMO one ticket or several is not very relevant ATM, just document what you perceive as problem/need for improvement (feature or bug as you feel it). The most important thing for me when I deal with a ticket is that I have to do close to zero effort in reproducing the problem (open attached file => do minimal amount of actions =>get the failure; or alternatively, a sequence of python console commands exposing the issue). BTW, the second most important is the analysis done by people trying to reproduce the issue (we have a vibrant community helping in the tracker/forum which save lots of developer time filtering out false positives and providing additional information in real bugs). We all make FreeCAD.

(See FC forum thread: https://forum.freecadweb.org/viewtopic.php?f=21&t=22781) creating language agnostic animated GIFs for free CAD to be displayed in freeCAD help files and possibly in app tooltips. below are some guidelines for GIFs creation:

  1. all GIFs will be the same color
  2. will have a standard size
  3. Will be language agnostic in other words will not show any text (in any language) to describe the action
  4. Will be a standard duration. Some GIFs will need to have a numerical single digit counter in the bottom left or right corner showing when the animation starts and ends
@luzpaz
luzpaz / metadata.txt
Last active June 1, 2017 15:13
FreeCAD Addon Manager metadata.txt boilerplate. Addon authors that are in favor of distributing their addon through the Addon Manager must include a customized version of this metadata.txt file.
; An example for this metadata.txt adapted from QGIS for FreeCAD
; http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/plugins.html#plugin-metadata
; All FreeCAD addons repos should fork this metadata.txt and adapt to their project
; the next section is mandatory
[general]
name=HelloWorld
email=me@example.com
author=Just Me
FreeCADMinimumVersion=0.17.xxxx