Skip to content

Instantly share code, notes, and snippets.

View oclero's full-sized avatar

Olivier Cléro oclero

View GitHub Profile
@oclero
oclero / zip-macos.sh
Created February 7, 2024 21:44
MacOS - Create a ZIP archive without .DS_Store and __MACOSX files
zip -r output.zip path/to/input_folder -x ".DS_Store" -x "__MACOSX"
@oclero
oclero / remove-git-branch.sh
Created November 12, 2023 18:33
Remove a Git branch, local and/or remote
# Remove a remote branch.
git push <remote> --delete <branch>
# Remove a local branch.
git branch --delete <branch>
git branch --delete --force <branch>
# Remove a local tracking branch.
git branch --delete --remotes <remote>/<branch>
git fetch <remote> --prune
@oclero
oclero / push-to-https-repo.sh
Last active March 29, 2024 20:10
Push to Git repository with https on Gitlab/Github
# Gitlab
git push https://gitlab-ci-token:<YOUR_TOKEN>@gitlab.com/<GROUP_NAME>/<REPO_NAME>.git <BRANCH_NAME> [--force]
# Github
git push https://<USERNAME>:<YOUR_TOKEN>@github.com/<USERNAME>/<REPO_NAME> <BRANCH_NAME> [--force]
@oclero
oclero / jpegoptim-recursive.sh
Created October 23, 2023 10:43
Run jpegoptim recursively
find . \( -iname \*.jpg -or -iname \*.jpeg \) -print0 | xargs -P 4 -n 1 -0 jpegoptim
@oclero
oclero / prettier-config-vscode.md
Last active October 1, 2023 10:50
Prettier configuration for VS Code and Hugo

Standard Way

  1. At the root of the repository, create a .prettierrc file:

    {
      "plugins": ["prettier-plugin-go-template"],
      "overrides": [
        {
          "files": ["*.html"],
@oclero
oclero / get-commits-from-other-remote.sh
Created September 7, 2023 17:11
Get commits from another Git remote
git fetch other-remote
git merge other-remote/some-branch
@oclero
oclero / git-graph-terminal.sh
Created August 17, 2023 09:30
Get git commits log as a graph in terminal
git log --color --graph --abbrev-commit
@oclero
oclero / allow-vst.sh
Created July 1, 2023 08:38
Allow VSTs from unidentified developers on MacOS
#!/bin/sh
sudo xattr -rd com.apple.quarantine /Library/Audio/Plug-Ins/VST/*
sudo xattr -rd com.apple.quarantine /Library/Audio/Plug-Ins/VST3/*
sudo xattr -rd com.apple.quarantine /Library/Audio/Plug-Ins/Components/*
@oclero
oclero / .zshrc
Last active May 26, 2023 09:06
Useful additions to zshrc
# homebrew
export PATH=$PATH:/opt/Homebrew/bin
# homebrew end
# cmake
export CMAKE_GENERATOR=Ninja
export CMAKE_OSX_ARCHITECTURES=arm64
# cmake end
# qt
@oclero
oclero / convert-png-to-jpg.sh
Created April 3, 2023 18:19
Convert Solarus PNG screenshot to bigger JPEG one
#!/bin/sh
# Needs imagemagick
for i in *.png; do convert "$i" -quality 90 -interpolate Nearest -filter point -resize 400% "${i%.*}.jpg"; done