Skip to content

Instantly share code, notes, and snippets.

View rosswintle's full-sized avatar

Ross Wintle rosswintle

View GitHub Profile
@rosswintle
rosswintle / functions.php
Created July 2, 2018 17:16
WordPress filters to make HTML password reset emails work
<?php
// adding support for html emails
// this converts ALL wp_mail emails to HTML, which messes up the password reset email
add_filter( 'wp_mail_content_type','prefix_set_content_type' );
function prefix_set_content_type() {
return "text/html";
}
// add this filter too
// this will make the password reset email compatible with the HTML format
@rosswintle
rosswintle / keybindings.json
Created February 13, 2018 14:18
Better terminal toggling keybindings in VS Code
[
// Focus/unfocus terminal with ctrl+` and toggle it with ctrl+shift+`
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus",
@rosswintle
rosswintle / gdpr-resources.md
Last active January 11, 2019 16:50
My public list of GDPR resources (slightly focussed on UK-based charities and non-profits rather than businesses)
@rosswintle
rosswintle / mysqlbackup.sh
Created January 10, 2018 10:38
MySQL backup all database script
#!/bin/sh
#
# This dumps all MySQL databases if you give it a root database login. You can specify the directory.
# It creates a date-and-timestamped sub-directory and individual files in there for each database.
#
HOSTNAME='localhost'
MYSQLUSER='root'
MYSQLPASS='password'
TIMESTAMP=`date +%F-%H%M%S`
@rosswintle
rosswintle / Stats.php
Created May 17, 2017 08:42
Simple Laravel Service Container/Provider example
<?php
// This is the Stats class I wanted to create. It lives in app/Stats.php, but could be anywhere that the AutoLoader will recognise it
namespace App;
use App\Action;
use Carbon\Carbon;
/**
@rosswintle
rosswintle / domain_info.php
Last active September 23, 2016 00:50
Domain Info script - attempts to give you registrar nameservers, basic DNS, actual hostname hosting the domain and MX records
<?php
/*
* This needs comments and command-line arguments and stuff. It's ruff and ready.
*/
global $domain_re;
$domain_re = '([0-9a-zA-Z\-]+\.)+[0-9a-zA-Z\-]+';
function get_nameservers( $whois_out, $domain ) {
@rosswintle
rosswintle / more-post.php
Created July 13, 2016 15:09
Tiny plugin to create a WordPress [more-post] shortcode. This is replaced by a button that loads the content within the shortcode.
<?php
/**
* Plugin Name: More Post - A Dynamic More Post loader
* Version: 0.1-alpha
* Description: A Dynamic More Post loader
* Author: Ross Wintle
* Author URI: http://oikos.digital
* Plugin URI: PLUGIN SITE HERE
* Text Domain: more-post
* Domain Path: /languages
@rosswintle
rosswintle / add_category_description_to_content.php
Last active February 25, 2016 17:13
WordPress plugin to add category description to end of the_content
<?php
/*
Plugin Name: Add category description to content
Plugin URI: https://oikos.digital/
Description: Adds the category description to the end of the_content()
Version: 1.0
Author: Ross Wintle/Oikos
Author URI: https://oikos.digital/
*/
@rosswintle
rosswintle / edit-divi-footer.php
Last active October 8, 2017 20:49
Edit Divi Footer plugin
@rosswintle
rosswintle / _grid.scss
Created December 31, 2015 23:40
Sage _grid.scss for use when using optional full-width templates.
// Grid system - do not apply to full-width-wrapped pages
.wrap.container .main {
@include make-sm-column($main-sm-columns);
.sidebar-primary & {
@include make-sm-column($main-sm-columns - $sidebar-sm-columns);
}
}
.sidebar {
@include make-sm-column($sidebar-sm-columns);
}