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 / rgb2cmyk.php
Last active November 17, 2023 21:57
Convert RGB to CMYK in PHP with Imagick
<?php
$iccProfile = '../path_to_icc/Profile.icc';
$image = new Imagick();
$image->clear();
$image->readImage($imagePath);
if ($image->getImageColorspace() == Imagick::COLORSPACE_CMYK) {
return;
}
$iccCmyk = file_get_contents($iccProfile);
@Neoglyph
Neoglyph / extensions.json
Last active November 10, 2023 10:29
VSCode's Settings - Syncing
[
{
"id": "aaron-bond.better-comments",
"name": "better-comments",
"publisher": "aaron-bond",
"version": "3.0.2"
},
{
"id": "adamgirton.gloom",
"name": "gloom",
@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