Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Aubrey AubreyHewes

💭
I may be slow to respond.
View GitHub Profile
@AubreyHewes
AubreyHewes / fix_multiple_domain_plugin_redirects.php
Created May 14, 2020
WordPress "Multiple Domain" & WPML compatability fix
View fix_multiple_domain_plugin_redirects.php
/**
* Configured "Multiple Domain" plugin does not redirect root properly when working with WPML...
*
* X.nl -> /
* Y.nl -> /
* X.com -> /en/
* Y.com -> /en/
*/
function fix_multiple_domain_plugin_redirects() {
if (strpos(MULTIPLE_DOMAIN_DOMAIN, '.com') === false) {
View keybase.md

Keybase proof

I hereby claim:

  • I am aubreyhewes on github.
  • I am aubz (https://keybase.io/aubz) on keybase.
  • I have a public key ASC3wMoMN2EgSqyGR6DsvQ3LN5HpEPVUWbYneS5JLtOS-wo

To claim this, I am signing this object:

@AubreyHewes
AubreyHewes / notify_slack_munin.sh
Last active Mar 28, 2019 — forked from hugochinchilla/slack_munin.sh
Slack notification script for Munin
View notify_slack_munin.sh
#!/usr/local/bin/bash
# Slack notification script for Munin
# Mark Matienzo (@anarchivist)
#
# To use:
# 1) Create a new incoming webhook for Slack
# 2) Edit the configuration variables that start with "SLACK_" below
# 3) Add the following to your munin configuration:
#
@AubreyHewes
AubreyHewes / ttf-mscorefonts-installer.sh
Last active Oct 24, 2018
ttf-mscorefonts-installer failure Ubuntu 18 18.04 18.10
View ttf-mscorefonts-installer.sh
#!/bin/bash
# After updating from 17.04 I get apt errors as the `ttf-mscorefonts-installer` package is not downloading
# the fonts properly timeouts/forbidden et al
sudo apt purge ttf-mscorefonts-installer
wget http://httpredir.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.7_all.deb
sudo apt install ./ttf-mscorefonts-installer_3.7_all.deb && rm ./ttf-mscorefonts-installer_3.7_all.deb
@AubreyHewes
AubreyHewes / A.markdown
Created Apr 26, 2018 — forked from larrybotha/A.markdown
Fix SVGs not scaling in IE9, IE10, and IE11
View A.markdown

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

View ReactChartJS.js
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ChartJS from 'chart.js';
/**
* React Wrapper Component for ChartJS charts
* Based on comment by @MatthewHerbst @https://github.com/reactjs/react-chartjs/issues/112
*
* For chart documentation see @see http://www.chartjs.org/docs/latest
*/
@AubreyHewes
AubreyHewes / redux-form-react-quill.jsx
Created Nov 10, 2017 — forked from Gaya/redux-form-react-quill.jsx
How to use React Quill inside Redux Forms
View redux-form-react-quill.jsx
import React from 'react';
import { Field } from 'redux-form';
import ReactQuill from 'react-quill';
function renderQuill({ input }) {
return (
<ReactQuill
{...input}
onChange={(newValue, delta, source) => {
if (source === 'user') {
View ip6tables_rules.sh
#!/bin/sh
# Reference ip6tables firewall rules for ICMPv6.
# Ref: https://www.cert.org/downloads/IPv6/ip6tables_rules.txt
#
# 11/07/2008
# Ryan Giobbi, CERT
#
# Please send feedback to <rag@cert.org>
# Don't use these rules on production systems without testing.
@AubreyHewes
AubreyHewes / rules-both.iptables
Created Oct 26, 2017 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
View rules-both.iptables
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@AubreyHewes
AubreyHewes / Install Budgie Desktop Ubuntu.md
Created May 11, 2017
Install Budgie Desktop on Ubuntu
View Install Budgie Desktop Ubuntu.md

Budgie on Ubuntu

Source: http://tipsonubuntu.com/2016/11/09/install-budgie-desktop-ubuntu-16-04-16-10/

Ubuntu Budgie now is an official Ubuntu flavor. For those who want to try this Gnome 3 based desktop environment, here is how to install Budgie Desktop in Ubuntu 16.04, Ubuntu 16.10. Also a complete uninstall guide is available. Budgie Desktop is a modern desktop features heavy integration with the GNOME stack. It’s the default desktop environment of Ubuntu Budgie (formerly known as Budgie Remix), which now is an official Ubuntu flavor.

Install Budgie Desktop in Ubuntu:

Budgie Remix Team has an official PPA repository. So far Ubuntu 16.04, Ubuntu 16.10, and their derivatives are supported.