Skip to content

Instantly share code, notes, and snippets.

View philipborbon's full-sized avatar

Philip Borbon philipborbon

View GitHub Profile
@philipborbon
philipborbon / queue worker cron
Created July 5, 2022 09:44
Running laravel worker on shared hosting using cron job
flock -xn /tmp/laravel_queues.lockfile -c "/usr/local/bin/php -dextension=/usr/local/php74/lib/php/extensions/imagick.so /home/customer/project/artisan queue:work"
@philipborbon
philipborbon / Untrack files already added to git repository based on gitignore.md
Last active September 7, 2022 03:42
Untrack files already added to git repository based on .gitignore

Untrack files already added to git repository based on .gitignore

By Jonathan Klughertz

Let's say you have already added/committed some files to your git repository and you then add them to your .gitignore; these files will still be present in your repository index. This article we will see how to get rid of them.

Step 1: Commit all your changes

Before proceeding, make sure all your changes are committed, including your .gitignore file.

Step 2: Remove everything from the repository

@philipborbon
philipborbon / post-receive [public_html]
Last active January 22, 2023 09:07
Deploy code to `public_html`
#!/bin/bash
TARGET="/home/wtqeysrg/project"
GIT_DIR="/home/wtqeysrg/project.git"
PUBLIC_DIR="/home/wtqeysrg/public_html"
BRANCH="master"
while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [ "$ref" = "refs/heads/$BRANCH" ];
@philipborbon
philipborbon / .bashrc
Last active December 30, 2022 20:22
CLI - multiple PHP composer setup
# Start SSH Agent
#----------------------------
SSH_ENV="$HOME/.ssh/environment"
function run_ssh_env {
. "${SSH_ENV}" > /dev/null
}
function start_ssh_agent {
@philipborbon
philipborbon / httpd-vhosts.conf
Created January 31, 2023 09:00
XAMPP Multi PHP Version Config
<VirtualHost *:80>
DocumentRoot "/path/to/project"
ServerName dev.project
<Directory "/path/to/project">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
@philipborbon
philipborbon / macos_high_sierra_apache_php_brew_2018.md
Created March 13, 2024 02:42 — forked from karlhillx/macos_high_sierra_apache_php_brew_2018.md
macOS High Sierra Setup: Homebrew + Apache + PHP + MariaDB + SSL

macOS High Sierra Setup: Homebrew + Apache + PHP + MariaDB + SSL

Homebrew Installation

First let's install Homebrew.

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"