Skip to content

Instantly share code, notes, and snippets.

View audetcameron's full-sized avatar

Cameron Audet audetcameron

View GitHub Profile
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active July 17, 2024 18:02
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@philipstanislaus
philipstanislaus / sane-caching.nginx.conf
Last active July 6, 2024 12:09
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@jacurtis
jacurtis / _spacing-helpers.scss
Last active May 30, 2024 17:41
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@fourstacks
fourstacks / Taxonomy.php
Last active January 6, 2023 03:15
Pulling in Yoast SEO meta for terms using Corcel
<?php
// This model simply inherits from the base Corcel Taxonomy model.
// It allows us to set our DB connection and also implement the
// ImportsTermSeo trait (see next file)
namespace App\Models\Corcel;
use App\Wordpress\ImportsTermSeo;
@chargoy
chargoy / gist:664e43ce0a99f9313d73c497376cfb5a
Last active October 17, 2022 21:12
laravel forge nginx with gzip & expires
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/sitio.com/before/*;
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name sitio.com;
root /home/forge/sitio.com/public;
# FORGE SSL (DO NOT REMOVE!)
@rsperl
rsperl / Makefile #snippet
Last active April 17, 2024 23:02
self-documenting makefile with colors
SHELL=/bin/bash
# to see all colors, run
# bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done'
# the first 15 entries are the 8-bit colors
# define standard colors
ifneq (,$(findstring xterm,${TERM}))
BLACK := $(shell tput -Txterm setaf 0)
RED := $(shell tput -Txterm setaf 1)
@bradtraversy
bradtraversy / django_crash_course.MD
Last active July 21, 2024 22:05
Commands for Django 2.x Crash Course

Django Crash Course Commands

# Install pipenv
pip install pipenv
# Create Venv
pipenv shell
@audetcameron
audetcameron / readme.md
Last active January 7, 2021 20:50
Bash and zsh aliases and helpers Laravel / NPM etc

aslias for .bashrc and or .zshrc

npm

list npm packages local and global

alias ng="npm list -g --depth=0 2>/dev/null"
alias nl="npm list --depth=0 2>/dev/null"
@viezel
viezel / test-octane.md
Last active April 22, 2023 00:47
Quick Laravel Octane test - UPDATED

Intro

I wanted to quickly take Laravel Octane beta for a spin, as we have been using Swoole for some time and wanted to see how official support performs vs what we have.

Test 2: Forge server

Next test is more real world as we now have a web server and database server within a VPC.

Using Laravel Forge