Skip to content

Instantly share code, notes, and snippets.

@lumpysimon
lumpysimon / vs-code-settings.json
Last active Jun 15, 2020
VS Code workplace settings with title bar colouring
View vs-code-settings.json
{
"folders": [
{
"path": "/path/to/my/workspace/folder"
}
],
"settings": {
"workbench.colorCustomizations": {
"titleBar.activeBackground": "#d12229",
"titleBar.activeForeground": "#ffffff",
@lumpysimon
lumpysimon / .lando.yml
Created May 16, 2018
Lando config file for Kirby with Apache, PHP 7.2, SSL and MailHog
View .lando.yml
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 Oct 9, 2020
Lando config file for WordPress with Nginx, PHP 7.2, MySQL 5.5, Xdebug, MailHog and PHPMyAdmin
View .lando.yml
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 Feb 28, 2019
Lando config file for WordPress with Apache, PHP 7.2, Xdebug, MailHog and PHPMyAdmin
View .lando.yml
name: mysite
recipe: wordpress
config:
php: '7.2'
webroot: public
xdebug: true
conf:
php: .vscode/php.ini
proxy:
mailhog:
View gulpfile.js
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 Jan 10, 2017
WordPress cache-busting stylesheet loader
View wp-stylesheet-loader.php
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 Sep 4, 2016
Remove WordPress emoji shit
View wp-remove-emoji.php
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 Nov 26, 2015
Completely disable WordPress REST API
View wp-disable-rest.php
add_filter( 'rest_enabled', '_return_false' );
add_filter( 'rest_jsonp_enabled', '_return_false' );
@lumpysimon
lumpysimon / hyphenate.css
Created Sep 30, 2015
Bulletproof hyphenation using CSS
View hyphenate.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 Jul 7, 2015
Set the WordPress password-protected post cookie expiry time
View gist:545c54e2876ebcbaf3c0
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.
}