Skip to content

Instantly share code, notes, and snippets.

View philipborbon's full-sized avatar

Philip Borbon philipborbon

View GitHub Profile
@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)"

@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 / post-receive [Laravel]
Last active January 22, 2023 09:08
Laravel production GIT post-receive
#!/bin/bash
TARGET="/home/user/project"
GIT_DIR="/home/user/project.git"
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" ];
then
@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 / git-deployment.md
Last active January 22, 2023 09:06 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@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 / 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 / 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 / ios-font-sizes.swift
Created September 2, 2021 09:23 — forked from zacwest/ios-font-sizes.swift
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
for style in styles {
@philipborbon
philipborbon / MySQL Development Database Note
Created January 18, 2021 10:19
Exposing MySQL development database in local network
- Check `bind-address` in MySQL configuration
- Check database user if is allowed for any host (%) or specific to host trying to connect
- Check firewall if port is exposed