Skip to content

Instantly share code, notes, and snippets.

Avatar

Jay Hoffmann JasonHoffmann

View GitHub Profile
@JasonHoffmann
JasonHoffmann / addon.js
Created Feb 15, 2018
Sample filterable block
View addon.js
/**
* 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 / gforms_styles.css
Created Sep 13, 2016
gravityforms-bootstrap4
View gforms_styles.css
.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;
View mithril.js
var PostList = {
controller: function(args) {
this.edit = function(post) {
if(post.editing() === true) {
post.editing(false);
} else {
post.previousTitle = post.title();
post.editing(true);
}
},
@JasonHoffmann
JasonHoffmann / responsive-mixin.scss
Last active Dec 19, 2016
Experimenting with SASS functions to create a responsive grid system with flexbox
View responsive-mixin.scss
@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; }
View lazy-load-images.php
<?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 Aug 27, 2014
Responsive Images in WordPress
View responsive-images.php
/*
* 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
You can’t perform that action at this time.