Skip to content

Instantly share code, notes, and snippets.

Avatar

Black Sail Division blacksaildivision

View GitHub Profile
View test.css
@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 / wp-head-clean.php
Last active May 27, 2020
Remove all unnecessary stuff from WordPress <head> tag
View wp-head-clean.php
<?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 / mysql-backup-database-to-s3.sh
Last active Aug 14, 2017
Backup MySQL database to AWS S3 bucket
View mysql-backup-database-to-s3.sh
#!/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
@blacksaildivision
blacksaildivision / httpd.service
Created Nov 12, 2016
SystemD (systemctl) script for managing Apache httpd compiled from source
View httpd.service
[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