Skip to content

Instantly share code, notes, and snippets.

View martwozniak's full-sized avatar
🟢
ONLINE

Marcin Wozniak martwozniak

🟢
ONLINE
View GitHub Profile
@martwozniak
martwozniak / deploy.sh
Created January 4, 2023 14:49 — forked from stancl/deploy.sh
Deploy using GitHub actions and SSH to a VPS
#!/bin/sh
set -e
vendor/bin/phpunit
npm run prod
git add .
(git commit -m "Build frontend assets for deployment to production") || true
(git push) || true

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@martwozniak
martwozniak / Readme.md
Created June 19, 2023 10:20 — forked from cutiko/Readme.md
Git delete last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

ORIGINAL did fork but search didn't helped me

@martwozniak
martwozniak / cloudflare-pages-bun.env
Created September 12, 2023 05:53 — forked from Hebilicious/cloudflare-pages-bun.env
Cloudflare Pages and Bun
# You can use these environments variables to enable bun in your CFP builds
SKIP_DEPENDENCY_INSTALL=true
UNSTABLE_PRE_BUILD=asdf plugin add bun && asdf install bun latest && asdf global bun latest && bun i
@martwozniak
martwozniak / phx_sqlite_fly_launch.md
Created October 29, 2023 17:21 — forked from mcrumm/phx_sqlite_fly_launch.md
Phoenix + SQLite Deployment tips

Deploying to Fly.io with SQLite

Deploying a Phoenix app to Fly.io is a breeze...is what everyone kept telling me. In fairness, I imagine the process would have been breezier had I just used postgres, but all the sqlite and litestream talk has been far too intriguing to ignore. "Wait", you say. "It is just a flat file. How much harder can it be?"

It is easy to make something harder than it should be. It is hard to take something complex and make it truly simple. flyctl launch does an amazing job at providing a simple interface to the utterly complex task of generating deployment resources, especially now that we are living in a containerd (erm, firecracker) world.

This gist is for anyone who, like me, thinks they know better than to read all of the documentation and therefore necessari

@martwozniak
martwozniak / ubuntu_boot_fix.txt
Created November 9, 2023 21:27 — forked from gpetuhov/ubuntu_boot_fix.txt
Fix boot after Ubuntu install
To fix boot menu after installing Ubuntu (for example when installing along with Windows):
https://help.ubuntu.com/community/Boot-Repair
install Boot Repair:
sudo apt-add-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
Choose 'Recommended Repair'