Skip to content

Instantly share code, notes, and snippets.

View obviousdisaster's full-sized avatar

Mark Hall obviousdisaster

  • Exeter, UK
  • 21:43 (UTC +01:00)
View GitHub Profile
@obviousdisaster
obviousdisaster / wp-config-additions.php
Created February 24, 2024 14:10
Wordpress wp-config.php additions
<?php
define( 'WP_MEMORY_LIMIT', '512M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
define( 'DISALLOW_FILE_EDIT', true );
define( 'COMPRESS_CSS', true );
define( 'COMPRESS_SCRIPTS', true );
define( 'CONCATENATE_SCRIPTS', true );
define( 'ENFORCE_GZIP', true );
define( 'WP_CACHE', true );
define( 'DISABLE_WP_CRON', true );
@obviousdisaster
obviousdisaster / .htaccess
Created February 24, 2024 14:09
Wordpress .htaccess
# force http to https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
# disable directory listing
Options -Indexes +FollowSymLinks -MultiViews
# turn off Apache version
ServerSignature Off
@obviousdisaster
obviousdisaster / wordpress-headers.php
Created February 24, 2024 12:28
Wordpress Headers
<?php
/**
* add security headers to Wordpress
*
* @author Mark Hall <https://markhall.dev>
*/
function add_headers()
{
header( 'Strict-Transport-Security: max-age=31536000' );
@obviousdisaster
obviousdisaster / gist:9e79baa07b8130aec03b04013df75a83
Created March 26, 2023 13:12
ASCII Character set + proportional font code
!"#$%&\'()*+,-./012
3456789:;<=>?@ABCDEF
GHIJKLMNOPQRSTUVWXYZ
[\\]^_`abcdefghijklm
nopqrstuvwxyz{|}~
//base_width = 64;
tilePlainFont.initTile( plainFont, 64, 63, 32 );
tilePlainFont.addSpecial(" ", 30 );
tilePlainFont.addSpecial("!", 17 );
{"version":1,"resource":"file:///home/markhall/Downloads/100552-jan-23-campaign-impulse-landing-page-v6-html/thankyou.php","entries":[{"id":"zXE5.php","timestamp":1671628436569},{"id":"Tb1u.php","timestamp":1671628456793},{"id":"JqHb.php","source":"searchReplace.source","timestamp":1671628482469}]}
@obviousdisaster
obviousdisaster / Local SSL's For Development [Ubuntu]
Last active February 17, 2023 20:40
Set up SSL certs for local development. Only method that's worked for me. Tested on Ubuntu v20.x
# store all ssl's in home
mkdir $HOME/ssl-certs
cd ~/ssl-certs
mkcert -install
# playground.test is our test site
mkcert playground.test
# apache conf files
cd /etc/apache2/sites-available/
@obviousdisaster
obviousdisaster / cf-hide-on-send.css
Created August 8, 2019 08:22
Hide form information on successful send in Contact Form 7
form.wpcf7-form.sent *
{
display: none;
}
div.wpcf7-response-output
{
display: block;
padding: 0;
border: 0;
@obviousdisaster
obviousdisaster / .gitignore
Created July 31, 2019 12:49
Wordpress .gitignore #wordpress #git
# ignore everything in the root except the "wp-content" directory.
!wp-content/
# ignore everything in the "wp-content" directory, except:
# "mu-plugins", "plugins", "themes" directory
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
# add these to ~/.gitconfig
[alias]
st = status
br = branch
ci = commit
co = checkout
dc = diff --cached
tree = log --all --decorate --oneline --graph
<hr />
<div class="row">
<div class="col-md-4">
[text* your-name class:form-control placeholder "Name (required)"]
</div>
<div class="col-md-4">
[email* your-email class:form-control placeholder "Email (required)"]