Skip to content

Instantly share code, notes, and snippets.

@luzpaz
luzpaz / grep.md
Last active February 10, 2025 13:09
CLI gems

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 -d '\n' -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)

@luzpaz
luzpaz / codespell_flags_foss.md
Last active January 24, 2025 11:49
codespell flags for different FOSS projects

FreeCAD

codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,aply,apoints,ba,beginn,behaviour,bloaded,bottome,brushin,bu,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,documentin,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,findn,fle,freez,graphin,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,renderin,rin,ro,rougly,sectionin,seperator,serie,shs,sinc,siz,som,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,uptodate,vas,vertexes,vew,wallthickness,whitespaces -S "./.git,*.po,*.ts,*.pdf,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<package format="1" xmlns="https://wiki.freecad.org/Package_Metadata">
<name>Zolkos Theme Package</name>
<description>A preference pack including a stylesheet with tabs</description>
<version>0.1.0</version>
<maintainer email="zolko@zolko.org">Zolko</maintainer>
<license file="LICENSE">GPLv3</license>
<url type="repository" branch="main">https://github.com/zolko/ZolkoThemePackage</url>
<icon>resources/icons/Zolko.svg</icon>
@luzpaz
luzpaz / git_commit_number_to_hash.sh
Last active August 8, 2022 19:11
List FreeCAD commits pending the local copy you're running
#!/bin/bash
# This script will ascertain what hash number (derived from revision number) your current
# local copy of FreeCAD is based on. Then it lists the commits that haven't made it in to
# said local copy.
git fetch --all # Make sure up-to-date
head=$(git rev-list --count HEAD)
echo -e "\n"
echo -e "Upstream: $head"
@luzpaz
luzpaz / oneliner.sh
Created August 6, 2022 11:24
Random useful oneliners
git show --pretty="" --name-only a9dc7b038d93ca96c776bd778f71458a4bc89a5e | grep -e '\.h$' | while read file; do md5sum ${file}; done
@luzpaz
luzpaz / FreeCAD-Addons-Workflow.md
Last active May 3, 2022 13:33
FreeCAD-Addons Guidelines

How to update the FreeCAD-Addons repo

git pull

###############################################

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

# for repos with default branch named: 'master'
# get total commit count
curl --silent -I -k "https://api.github.com/repos/FreeCAD/FreeCAD/commits?per_page=1" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p'
# get AppImage release number
curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FreeCAD/FreeCAD-bundle/releases/tags/weekly-builds | jq '.assets[].name' | grep -e 'AppImage\"$' | sed -r 's/.*-([0-9]{5}).*/\1/'
From d23b1d79362b64690dbe17cfb75f152e183ea4b1 Mon Sep 17 00:00:00 2001
From: luz paz <luzpaz@github.com>
Date: Thu, 31 Mar 2022 09:22:00 -0400
Subject: [PATCH] Fix various documentation and source comment typos
Signed-off-by: luz paz <luzpaz@github.com>
---
ccx_2.19/src/CalculiX.h | 4 ++--
ccx_2.19/src/README.INSTALL | 2 +-
ccx_2.19/src/add_rect.c | 6 +++---
@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