Skip to content

Instantly share code, notes, and snippets.

@lumpysimon
lumpysimon / vs-code-settings.json
Last active June 15, 2020 14:32
VS Code workplace settings with title bar colouring
{
"folders": [
{
"path": "/path/to/my/workspace/folder"
}
],
"settings": {
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#d12229",
"titleBar.activeForeground": "#ffffff",
@lumpysimon
lumpysimon / .lando.yml
Created May 16, 2018 13:02
Lando config file for Kirby with Apache, PHP 7.2, SSL and MailHog
name: kirby
proxy:
appserver:
- kirby.lndo.site
mailhog:
- mail.kirby.lndo.site
services:
appserver:
type: php:7.2
via: apache
@lumpysimon
lumpysimon / .lando.yml
Last active October 9, 2020 22:08
Lando config file for WordPress with Nginx, PHP 7.2, MySQL 5.5, Xdebug, MailHog and PHPMyAdmin
name: mysite2
recipe: wordpress
config:
php: '7.2'
via: nginx
webroot: public
xdebug: true
conf:
php: .vscode/php.ini
proxy:
@lumpysimon
lumpysimon / .lando.yml
Last active February 28, 2019 17:31
Lando config file for WordPress with Apache, PHP 7.2, Xdebug, MailHog and PHPMyAdmin
name: mysite
recipe: wordpress
config:
php: '7.2'
webroot: public
xdebug: true
conf:
php: .vscode/php.ini
proxy:
mailhog:
var gulp = require('gulp'),
sass = require('gulp-sass'),
prefix = require('gulp-autoprefixer'),
sourcemaps = require('gulp-sourcemaps'),
livereload = require('gulp-livereload'),
input = {
'sass': [
'sass/**/*.scss'
]
@lumpysimon
lumpysimon / wp-stylesheet-loader.php
Last active January 10, 2017 09:52
WordPress cache-busting stylesheet loader
add_action( 'wp_enqueue_scripts', 'abc_styles' );
function abc_styles() {
wp_enqueue_style(
'abc',
get_stylesheet_uri(),
array(),
filemtime( get_template_directory() . '/style.css' )
);
@lumpysimon
lumpysimon / wp-remove-emoji.php
Created September 4, 2016 22:06
Remove WordPress emoji shit
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
@lumpysimon
lumpysimon / wp-disable-rest.php
Created November 26, 2015 22:44
Completely disable WordPress REST API
add_filter( 'rest_enabled', '_return_false' );
add_filter( 'rest_jsonp_enabled', '_return_false' );
@lumpysimon
lumpysimon / hyphenate.css
Created September 30, 2015 23:53
Bulletproof hyphenation using CSS
.hyphenate {
overflow-wrap: break-word;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@lumpysimon
lumpysimon / gist:545c54e2876ebcbaf3c0
Created July 7, 2015 16:04
Set the WordPress password-protected post cookie expiry time
add_filter( 'post_password_expires', 'my_cookie_time' );
function my_cookie_time( $time ) {
return 600; // 600 = 10 minutes. Use 0 to expire the cookie at the end of the current browsing session.
}