Skip to content

Instantly share code, notes, and snippets.

View Neoglyph's full-sized avatar
🧙
wizard in training since 1989

Adam Stradovnik Neoglyph

🧙
wizard in training since 1989
View GitHub Profile
@Neoglyph
Neoglyph / gist:18ccd93a28a221bad418c97a84fd9d55
Created December 19, 2023 09:05
AlpineJS 3 / Livewire 2 - $wire undefined
Do not forget to include `window.Alpine = Alpine`
@Neoglyph
Neoglyph / merge-pdf-ghostscript.md
Created April 4, 2022 06:53 — forked from brenopolanski/merge-pdf-ghostscript.md
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

@Neoglyph
Neoglyph / git-delete-branches.sh
Created February 3, 2021 12:52
Delete local branches that are already merged
git branch --merged | egrep -v "(^\*|master|main|dev)" | xargs git branch -d
@Neoglyph
Neoglyph / rebase-and-merge
Created March 23, 2020 14:04
Rebase and merge to dev
git checkout BRANCH && git rebase dev && git push origin BRANCH --force-with-lease && git checkout dev && git merge BRANCH && git push origin dev
@Neoglyph
Neoglyph / git-delete-branches.sh
Last active March 17, 2020 08:05
Delete branches already merged into current head
# https://stevenharman.net/git-clean-delete-already-merged-branches
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
@Neoglyph
Neoglyph / git-delete-branches.sh
Created March 17, 2020 08:05
Delete branches already merged into current head
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
@Neoglyph
Neoglyph / resize_200_200.sh
Created February 27, 2020 12:03
Resize and override images (200x200)
find . -maxdepth 1 -iname "*.png" | xargs -L1 -I{} convert -resize 200x200 "{}" "{}"
@Neoglyph
Neoglyph / revert-commit
Created August 29, 2019 12:16
Revert Commit GIT
# Reset the index to the desired tree
git reset HASH
# Move the branch pointer back to the previous HEAD
git reset --soft HEAD@{1}
git commit -m "Revert to HASH"
# Update working copy to reflect the new commit
git reset --hard
@Neoglyph
Neoglyph / prevent-scroll.scss
Created August 22, 2019 13:57
Prevent ios mobile scroll on mobile
body.on-scroll {
overflow-y: hidden !important;
}
.modal-overlay {
-webkit-overflow-scrolling: touch;
}
@Neoglyph
Neoglyph / redis-cli-delete
Created August 21, 2019 08:07
REDIS delete keys by pattern
Lets say your keys start with `sync:`
Removes the whole key store
redis-cli --scan --pattern sync:* | xargs redis-cli del
Removes the key store for a specific parameter
redis-cli --scan --pattern sync:PARAMETER | xargs redis-cli del