Skip to content

Instantly share code, notes, and snippets.

@luzpaz
luzpaz / FreeCAD-Addons-Workflow.md
Last active Sep 6, 2021
FreeCAD-Addons Guidelines
View FreeCAD-Addons-Workflow.md

How to update the FreeCAD-Addons repo

git pull

# git submodule foreach git checkout master
# Skip certain submodules https://stackoverflow.com/a/58292036

git submodule foreach 'case $name in MnesarcoUtils|SlopedPlanesMacro|Design456|OpticsWorkbench) ;; *) git checkout master ;; esac'

# git submodule foreach git pull
@luzpaz
luzpaz / grep.txt
Last active Jul 30, 2021
CLI gems
View grep.txt
grep -R (recurse through subdirectories)
grep -i (Case insensitive)
grep -e (extended regex, allows for regex modifiers)
grep -l (only returns file name)
grep -Rle 'aligne\b' | xargs sed -i 's/aligne\b/align/'g
# search for the string 'aligne' (don't returns strings like 'aligned')
# pass all files that have said string to xargs which quickly processes
# sed (with the -i flag to process in place)
View Codespell-1-line-tests.txt
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
View freetype-typos.patch
From 63107a4d7679a805ec494596597727d0624f02c9 Mon Sep 17 00:00:00 2001
From: luz paz <luzpaz@github.com>
Date: Sat, 10 Jul 2021 19:05:32 -0400
Subject: [PATCH] Fix various typos
Found via ./src/autofit/aflatin.c:1697: inbetween ==> between, in between
./src/autofit/afhints.c:1056: inbetween ==> between, in between
./src/pshinter/pshalgo.c:805: inbetween ==> between, in between
./src/gxvalid/gxvjust.c:252: Threshhold ==> Threshold
./src/pfr/pfrload.c:291: acount ==> account
@luzpaz
luzpaz / codespell_flags_foss.md
Last active Apr 13, 2021
codespell flags for different FOSS projects
View codespell_flags_foss.md
View FC-Cmake-summary.txt
==============
Summary report
==============
-- Build type: None
-- Compiler: /usr/bin/c++ (10.2.0)
-- Flags: -Wall -Wextra -Wno-write-strings -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fPIC -w
-- Standard: Requires C++14
-- Python: [/usr/bin/python] [.cpython-39-x86_64-linux-gnu]
-- PCL: not enabled
@luzpaz
luzpaz / API_Guide.md
Last active Dec 29, 2020
FreeCAD API notes
View API_Guide.md
View gist:560e092fcea6c425959e46fed79f941f
  • Patching from https://.patch file

    curl https://github.com/GNOME/gimp/compare/master...luzpaz:typos.diff | git apply -v
    
  • Patching a FreeCAD workbench from a PR

    cd ~/.FreeCAD/Mod/sheetmetal/
    git fetch 
    curl -ss https://patch-diff.githubusercontent.com/raw/shaise/FreeCAD_SheetMetal/pull/146.patch | git apply
    
@luzpaz
luzpaz / gist:2c1cdb0a7919123558cf5c28fa39646a
Created Nov 29, 2020
List of .svg files in ./src/Mod
View gist:2c1cdb0a7919123558cf5c28fa39646a
./src/Mod/Tux/Resources/icons/NavigationMayaGesture_Rotate.svg
./src/Mod/Tux/Resources/icons/NavigationTouchpad_ZoomAlt.svg
./src/Mod/Tux/Resources/icons/NavigationCAD_RotateAlt.svg
./src/Mod/Tux/Resources/icons/NavigationGesture_Tilt.svg
./src/Mod/Tux/Resources/icons/NavigationMayaGesture_Tilt.svg
./src/Mod/Tux/Resources/icons/NavigationOpenInventor_Rotate.svg
./src/Mod/Tux/Resources/icons/NavigationOpenInventor_Zoom.svg
./src/Mod/Tux/Resources/icons/NavigationGesture_Zoom.svg
./src/Mod/Tux/Resources/icons/NavigationRevit_Rotate.svg
./src/Mod/Tux/Resources/icons/NavigationGesture_Select.svg
@luzpaz
luzpaz / Valentina.rb
Last active Nov 16, 2020
Valentina Project Homebrew forumula
View Valentina.rb
require 'formula'
class Valentina < Formula
head 'https://bitbucket.org/dismine/valentina/get/develop.zip'
homepage 'http://valentina-project.org'
# version "0.2.8"
depends_on 'qt5' => :build
depends_on 'ccache' => :build
depends_on 'xpdf' => :optional