Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@drbyte
drbyte / config.referral_tracking.php
Created December 11, 2023 22:48
Coupon/ReferralCode Tracking / auto-apply in Zen Cart
<?php
$autoLoadConfig[100][] = array('autoType'=>'init_script',
'loadFile'=> 'init_referral_tracking.php');
@drbyte
drbyte / laravel-forge-deploy.sh
Created February 19, 2017 20:23 — forked from rap2hpoutre/laravel-forge-deploy.sh
Laravel Forge deploy script without downtime
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/deploy" ]; then
rm -R /home/forge/deploy
fi
if [ -d "/home/forge/backup" ]; then
rm -R /home/forge/backup
fi
@drbyte
drbyte / Regex patterns to detect old PHP code.txt
Last active September 4, 2021 21:40
Regex patterns to detect old PHP code
Find each() and create_function() calls >= PHP 7.2
=(\W)?(each|create_function) ?\(
(or look for the while/list/each construct):
while\W?\(\W?list\W?\(.*=\W?each\(
Find all SHORT tags >= 5.3
(.*)<\?(?!(p|x|=))(.*)
@drbyte
drbyte / .htaccess
Created September 2, 2017 15:42
.well-known rewrites for apache
# ----------------------------------------------------------------------
# Put well known resources in the .well-known folder
# https://github.com/fvsch/scripts-and-snippets/blob/master/apache/rewrite-well-known.conf
# ----------------------------------------------------------------------
RewriteCond %{REQUEST_FILENAME} !-f
# Some very common, then less common "well-known" patterns
RewriteCond %{REQUEST_URI} =/favicon.jpg [OR]
RewriteCond %{REQUEST_URI} =/favicon.ico [OR]
@drbyte
drbyte / keybase.md
Created January 14, 2021 17:18
keybase.md

Keybase proof

I hereby claim:

  • I am drbyte on github.
  • I am drbyte (https://keybase.io/drbyte) on keybase.
  • I have a public key ASDMu4L2lyvJ_WV0dPjk8FnquqW9fU13W2ufxphqLcX3QQo

To claim this, I am signing this object:

@drbyte
drbyte / change ckeditor from google api to jquery
Last active June 16, 2020 21:44
ckeditor fix for very old implementations
Look at your /admin/includes/ckeditor.php file
// REMOVE THESE TWO LINES:
<script type="text/javascript" src="<?php echo (strstr(HTTP_SERVER, 'ttps:') ? 'https' : 'http'); ?>://www.google.com/jsapi"></script>
<script type="text/javascript">if (typeof jQuery == 'undefined') google.load("jquery", "1");</script>
// REPLACE THEM WITH THIS LINE:
<script>window.jQuery || document.write('<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"><\/script>');</script>
@drbyte
drbyte / dusk-chrome-update.sh
Created May 23, 2020 03:51
Dusk Chrome Update bash script MacOS
#!/bin/bash
# https://chromedriver.storage.googleapis.com/LATEST_RELEASE
# https://chromedriver.storage.googleapis.com/%s/chromedriver_mac64.zip
# unzip
# mv chromedriver /vendor/laravel/dusk/bin/chromedriver-mac
if [ ! -f "./vendor/laravel/dusk/bin/chromedriver-mac" ]; then echo 'No Dusk Dir.' && exit 1; fi
a=$(uname -m) &&
rm -r ~/Downloads/chromedriver/
@drbyte
drbyte / deployment_guide.md
Created April 5, 2019 18:28 — forked from vicgonvt/deployment_guide.md
Deployment Guide for Ubuntu Server from Scratch with Laravel

Setting Up Laravel in Ubuntu / DigitalOcean

Getting Started

  • Create droplet with Ubuntu 18.10
  • ssh root@[DROPLET IP ADDRESS]
  • Get password from your email
  • Change password on first login
  • adduser laravel
  • Enter password and other information
<?php
namespace App\Notifications;
use App\Helpers\RemembersLocale;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Notifications\Channels\FirebaseChannel;
@drbyte
drbyte / valet.conf
Created October 18, 2017 16:23 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;