Skip to content

Instantly share code, notes, and snippets.

View blacksaildivision's full-sized avatar

Black Sail Division blacksaildivision

View GitHub Profile
@blacksaildivision
blacksaildivision / wp-head-clean.php
Last active April 19, 2023 11:12
Remove all unnecessary stuff from WordPress <head> tag
<?php
/**
* Alter dns-prefetch links in <head>
*/
add_filter('wp_resource_hints', function (array $urls, string $relation): array {
// If the relation is different than dns-prefetch, leave the URLs intact
if ($relation !== 'dns-prefetch') {
return $urls;
}
@blacksaildivision
blacksaildivision / httpd.service
Created November 12, 2016 14:39
SystemD (systemctl) script for managing Apache httpd compiled from source
[Unit]
Description=The Apache HTTP Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/apache2/bin/apachectl -k start
ExecReload=/usr/local/apache2/bin/apachectl -k graceful
ExecStop=/usr/local/apache2/bin/apachectl -k graceful-stop
PIDFile=/usr/local/apache2/logs/httpd.pid
@font-face {
font-family: 'LetteraMonoLLWeb';
font-weight: 300;
src: url('https://dragonfired.co.nz/fonts/LetteraMonoLLWeb-Light.woff2') format('woff2')
}
@font-face {
font-family: 'LetteraMonoLLWeb';
font-weight: 300;
src: url('https://dragonfired.co.nz/fonts/LetteraMonoLLWeb-Light.woff') format('woff')
@blacksaildivision
blacksaildivision / mysql-backup-database-to-s3.sh
Last active August 14, 2017 08:57
Backup MySQL database to AWS S3 bucket
#!/bin/bash
##
# There are two requirements for this script to work:
# 1. You must have AWS CLI installed andd configured with ./aws/credentials and ./aws/config files
# 2. You must have .my.cnf file configured for MySQL with credentials for user that has at least SELECT privileges for database to backup
#
# Usage:
# 1. Make sure that AWS CLI and S3 bucket is working properly
# 2. Make sure that you have user for creating backups in MySQL and .my.cnf file configured properly