Skip to content

Instantly share code, notes, and snippets.

View jwhulette's full-sized avatar
🏠
Working from home

Wes Hulette jwhulette

🏠
Working from home
View GitHub Profile
@jwhulette
jwhulette / vhost.ApacheConf
Last active April 2, 2018 18:03
[Apache Vhost] #apache
DocumentRoot /usr/local/www/apache24/data/public
ServerName vagrant.local
AccessFileName .htaccess-dev
DirectoryIndex /index.php index.php
# Defining a worker will improve performance
# And in this case, re-use the worker (dependent on support from the fcgi application)
# If you have enough idle workers, this would only improve the performance marginally
<Proxy "fcgi://localhost:9000/" enablereuse=on max=10>
</Proxy>
@jwhulette
jwhulette / CronSchedule.php
Last active June 20, 2020 14:50 — forked from m4tthumphrey/CronSchedule.php
[CronSchedule] Allows one to parse a cron expression into human readable text. #php
<?php
namespace App\Models\Common;
/*
* Plugin: StreamlineFoundation
*
* Class: Schedule
*
* Description: Provides scheduling mechanics including creating a schedule, testing if a specific moment is part of the schedule, moving back
@jwhulette
jwhulette / php_timezones.php
Last active November 19, 2020 03:52
[PHP Timezones] #php
/**
* Timezone calculations
*/
class Timezone
{
/**
* Timezones list with GMT offset
*
* @return array
@jwhulette
jwhulette / Laravel Zero Hide Commands
Last active July 25, 2021 22:59
[Laravel Zero Hide Commands] #laravel #php
'hidden' => Phar::running() ? [
NunoMaduro\Collision\Adapters\Laravel\Commands\TestCommand::class,
NunoMaduro\LaravelConsoleSummary\SummaryCommand::class,
Symfony\Component\Console\Command\HelpCommand::class,
LaravelZero\Framework\Commands\MakeCommand::class,
LaravelZero\Framework\Commands\BuildCommand::class,
LaravelZero\Framework\Commands\InstallCommand::class,
LaravelZero\Framework\Commands\RenameCommand::class,
LaravelZero\Framework\Commands\StubPublishCommand::class,
Illuminate\Console\Scheduling\ScheduleRunCommand::class,
@jwhulette
jwhulette / Laravel dynamic log path
Last active July 25, 2021 23:00
[Laravel dynamic log path] #php #laravel
$handler = new StreamHandler($path);
$handler->setFormatter(new LineFormatter(null, "Y-m-d H:i:s", true, true));
Log::channel('upkfile')->getLogger()->popHandler();
Log::channel('upkfile')->getLogger()->pushHandler($handler);
@jwhulette
jwhulette / .eslintrc.js
Last active July 25, 2021 23:02
[Vue VSCode setup] #vscode #vuejs
module.exports = {
root: true,
env: {
browser: true,
},
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
},
extends: [
@jwhulette
jwhulette / Apache_rewrite_to_Amazon_S3.txt
Last active July 25, 2021 23:03 — forked from NapoleonWils0n/Apache_rewrite_to_Amazon_S3.txt
[Apache S3 Rewrite] #apache #aws
<Directory "/www/sitename/folder/">
<IfModule mod_rewrite.c>
RewriteEngine ON
RewriteRule ^(.*) http://bucktname.s3.amazonaws.com/folder/$1
</IfModule>
</Directory>
@jwhulette
jwhulette / .htaccess
Last active July 25, 2021 23:03
[A base .htaccess with HTTPS redirect behind an AWS Load Balancer] #apache #aws
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Force HTTPS - Proto needed for AWS ELB
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker
@jwhulette
jwhulette / aws_cloud_watch_laravel_log.txt
Last active July 25, 2021 23:04
[Cloudwatch Multiline] #aws
multi_line_start_pattern = {datetime_format}
@jwhulette
jwhulette / www.conf
Last active July 27, 2022 13:02
[www.conf] A base php-fpm www.conf file #php
; See https://spot13.com/pmcalculator/ for configuration
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'