Useful Git Aliases

If you’re a software developer, you most likely use git. Many people are not aware that you can create an alias for commands. Creating alias will make commands easier to remember and quicker to type. Here are some of my favorite git alias I use on a regular basis.

Short for git status

alias gs="git status"

Quickly commit with wip message

alias wip='git add . && git commit -m "wip"'

Updates your branch and submodules

alias gpa = "!git pull --rebase --prune [email protected] && git submodule update --init --recursive"

Reset all changes (use with caution)

alias nah="git reset --hard && git clean -df"

 

Leave a comment below on your favorite alias commands.

Laravel, Cloudflare and Trusted Proxies

When using Cloudflare to manage your site, you may notice that if you check the ip address of the request, it will be an ip address from Cloudflare. This is happening because Cloudflare is proxying the request to your server. To get around this issue and get the original request ip, you need to configure trusted proxies in Laravel.

This is important because the throttle middleware checks the request ip and throttles based on ip. If all request look like they are coming from Cloudflare, this will cause issues. Read More

Backup Multiple Laravel Sites

If you’re like me and use Laravel Forge to host multiple websites on a single Digital Ocean server, then you may have run into the issue where you need to backup all the sites on your server. You could run Spatie Laravel Backup package on each site but a better solution would be to just deploy a single backup application to the server so you can backup multiple sites. This means you can backup multiple types of sites including WordPress.

I came across a great article from Tim MacDonald. Check it out here

Let me know if you have any questions.

Side Project Tech Stack

I want to start this post by saying this is my preference on the frameworks and technologies that I use for most of my apps. Depending on your experience and goals you should experiment to see what works for you. For example, here’s a tweet from Pieter Levels that his site is running on a single PHP file and is making over $2,000 a day. He makes a good point that if your goal is to make money, the frameworks and libraries can get in the way of you making progress. It’s impressive what he is able to accomplish by keeping things simple.

Read More