Skip to content

Instantly share code, notes, and snippets.

View JasonHoffmann's full-sized avatar

Jay Hoffmann JasonHoffmann

View GitHub Profile
<?php
class WPLazyLoadImages {
function __construct() {
// Add Our Filters and actions for the plugin
add_action('wp_enqueue_scripts', array($this, 'enqueue_lazyload'));
add_filter('the_content', array($this, 'filter_lazyload'));
add_action('wp_footer', array($this, 'footer_lazyload'));
@JasonHoffmann
JasonHoffmann / responsive-images.php
Created August 27, 2014 21:10
Responsive Images in WordPress
/*
* Start by creating a few image sizes for us to use
*/
add_image_size('smallest', 479, 9999);
add_image_size('small', 768, 9999);
add_image_size('largest', 1800, 9999);
/*
* Enqueue our Picturefill Javascript
@JasonHoffmann
JasonHoffmann / gforms_styles.css
Created September 13, 2016 03:22
gravityforms-bootstrap4
.btn > .caret, .gform_button > .caret,
.dropup > .btn > .caret,
.dropup > .gform_button > .caret {
border-top-color: #000 !important;
}
.gform_fields {
padding-left: 0;
list-style: none;
margin-left: -15px;
@JasonHoffmann
JasonHoffmann / addon.js
Created February 15, 2018 14:49
Sample filterable block
/**
* This is an example of a script that would hook into the filter or
* subscribe to some sort of data. I want to make the assumption that
* this could be non-ES6 code with no access to the spread operator, so
* something like push would be used instead.
*/
function rkvAddPython( codeList ) {
codeList.push( {
title: 'Python',
codemirror: 'python',
@JasonHoffmann
JasonHoffmann / responsive-mixin.scss
Last active December 19, 2016 15:39
Experimenting with SASS functions to create a responsive grid system with flexbox
@mixin bp($point) {
$bp-babybear: "(max-width: 600px)";
$bp-papabear: "(max-width: 950px)";
@if $point == papa-bear {
@media #{$bp-papabear} { @content; }
}
@else if $point == baby-bear {
@media #{$bp-babybear} { @content; }
@JasonHoffmann
JasonHoffmann / coworkers.json
Last active October 13, 2016 00:48
Coworkers List
fff
@JasonHoffmann
JasonHoffmann / mithril.js
Created May 19, 2015 19:32
Mithril Problem
var PostList = {
controller: function(args) {
this.edit = function(post) {
if(post.editing() === true) {
post.editing(false);
} else {
post.previousTitle = post.title();
post.editing(true);
}
},