Skip to content

Instantly share code, notes, and snippets.

View ethanclevenger91's full-sized avatar

Ethan Clevenger ethanclevenger91

View GitHub Profile
@jatubio
jatubio / .php_cs
Created June 13, 2015 11:51
Config file to pass PHP-CS-Fixer with Laravel 5.1 custom and PSR-2 styles coding
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/cache')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
@gilbitron
gilbitron / after.sh
Last active March 1, 2023 22:06
Laravel Homestead daily database backup cron provision (after.sh)
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
if [ ! -f /etc/cron.daily/database-backup ]; then
sudo bash -c "cat > /etc/cron.daily/database-backup" <<EOL
#!/bin/bash
@cliffordp
cliffordp / functions.php
Last active February 26, 2020 21:55
The Events Calendar: Change Event Archives' iCalendar export links to webcal://
<?php
/**
* The Events Calendar: Change Event Archives' iCalendar export links to webcal://
*
* This causes the "iCal Export" button to recommend to calendar applications
* (e.g. Apple, Outlook, etc.) that they should *subscribe* instead of *download*.
*
* We have to use JavaScript instead of PHP because the "Export Events"
* iCalendar link gets built via JS via
* /wp-content/plugins/the-events-calendar/src/resources/js/tribe-events.min.js
@maddisondesigns
maddisondesigns / functions.php
Last active February 7, 2024 13:42
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
@barchard
barchard / forge_ioncube_php.sh
Created May 18, 2018 00:37 — forked from mechawrench/forge_ioncube_php_71.sh
Laravel Forge IonCube 7.1 Installation Recipe
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxvf ioncube_loaders_lin_x86-64.tar.gz
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(php-config --extension-dir)
PHP_CONFD="/etc/php/${PHP_VERSION}/fpm/conf.d"
cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" $PHP_EXT_DIR
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/00-ioncube.ini"
PHP_CONFD="/etc/php/${PHP_VERSION}/cli/conf.d"
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(php-config --extension-dir)
@polevaultweb
polevaultweb / acf_pro_license_constant.php
Last active March 22, 2023 03:06
Define the Advanced Custom Fields Pro license key with a constant
<?php
function my_filter_acf_pro_license_option( $pre ) {
if ( ! defined( 'ACF_PRO_LICENSE' ) || empty( ACF_PRO_LICENSE ) ) {
return $pre;
}
$data = array(
'key' => ACF_PRO_LICENSE,
'url' => home_url(),
@freekmurze
freekmurze / 2021_02_17_103523_migrate_to_jetstream.php
Last active June 11, 2022 19:55
Migrate classic Spark tables to Jetstream + new Spark
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class MigrateToJetstream extends Migration
{
public function up()
{
@gilbitron
gilbitron / CaddyController.php
Created June 16, 2021 10:55
Enabling HTTPS (SSL) for Laravel Sail using Caddy
<?php
# app/Http/Controllers/CaddyController.php
namespace App\Http\Controllers;
use App\Store;
use Illuminate\Http\Request;
class CaddyController extends Controller
{