Skip to content

Instantly share code, notes, and snippets.

@trevanhetzel
trevanhetzel / table-sorting.js
Created June 14, 2017 03:21
Simple table sorting for dates, strings & integers w/ jQuery & ES6
/**
* Custom table sorting
*/
import $ from 'jquery';
export default {
// Set this opposite to what the default ordering is
DESC: false,
@trevanhetzel
trevanhetzel / app.js
Created August 30, 2016 22:39
Simple jQuery Mockjax & Browserify example
/**
* Main application file
*/
'use strict';
var $ = require('jquery'),
mockjax = require('jquery-mockjax')($, window);
$.mockjax({
@trevanhetzel
trevanhetzel / lazyload-video.html
Last active August 29, 2015 14:18
"Lazyload" videos
<video preload="none" autoplay loop poster="path/to/poster.jpg">
<source src="path/to/video.mp4" type="video/mp4">
<source src="path/to/video.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
@trevanhetzel
trevanhetzel / app.js
Last active March 14, 2019 12:29
Retrieve & show ALL tags used on a Ghost blog
// List item to append tags to
var $tagList = $('.tags');
// Get your data from this nice little endpoint in JSON form
$.get('/ghost/export/', function (data) {
var tags = data.data.tags;
for (var tag in tags) {
var tagName = tags[tag].name,
tagSlug = tags[tag].slug;
@trevanhetzel
trevanhetzel / fb-album-fetcher.js
Last active July 30, 2022 03:09
Facebook Album Fetcher
/* Descripton: A basic plugin to fetch all albums and associated photos from a Facebook page
* Usage: Simply reference the script and instantiate it
* Example instantiaion:
$(window).load(function () {
albumFetcher({
fbId: "137248356344058",
container: ".photos"
});