Skip to content

Instantly share code, notes, and snippets.

@simondoescode
simondoescode / gulpfile.js
Last active March 23, 2017 13:12
Front end dev gulpfile - browserSync, sass, uglify, plumber
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var uglifyCss = require('gulp-uglifycss');
var plumber = require('gulp-plumber');
gulp.task('browserSync', function(){
browserSync.init({
@simondoescode
simondoescode / gulpfile.js
Created March 20, 2017 14:43
Gulp- Browser Sync mamp
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
gulp.task('browserSync', function(){
browserSync.init({
proxy: "http://localhost/app/"
});
gulp.watch("./app/*.php").on("change", browserSync.reload);
});
@simondoescode
simondoescode / wordpress_low-quality-image-placeholders_lqip.md
Created February 27, 2017 16:28 — forked from ctlcltd/wordpress_low-quality-image-placeholders_lqip.md
How to easily generate low quality image placeholders (lqip) in WordPress

#How to easily generate low quality image placeholders (lqip) in WordPress

I have made this function using the WP_Image_Editor class and I have filtered through the "wp_generate_attachment_metadata" hook. You can modify the "theme" namespace into function names with your theme name or in anyway you like.

Applying the filter directly to wp_generate_attachment_metadata the image placeholders are auto added into WordPress metadata, so when your add/modify/delete an image (or regenerate it via a plugin), it accomplishes to modify also to the image placeholders.

The use of the native theme support can prevent the generation of lqip or target specific image sizes to generate.

It contains an hook filter lqip_quality to modify the quality without have to modify the function.

@simondoescode
simondoescode / functions.php
Created October 11, 2016 20:30 — forked from JoostKiens/functions.php
Improve the WordPress caption shortcode with HTML5 figure & figcaption, microdata & wai-aria attributes
<?php
/**
* Improves the WordPress caption shortcode with HTML5 figure & figcaption, microdata & wai-aria attributes
*
* Author: @joostkiens
* Licensed under the MIT license
*
* @param string $val Empty
* @param array $attr Shortcode attributes
* @param string $content Shortcode content