Skip to content

Instantly share code, notes, and snippets.

View imshuffling's full-sized avatar
🏠
Working from home

David Riches imshuffling

🏠
Working from home
View GitHub Profile
@imshuffling
imshuffling / 00-Readme.md
Created March 23, 2021 15:05 — forked from grncdr/00-Readme.md
Delete unused assets

Delete unused assets

This is an example script for deleting assets that aren't linked in your content model. It does this by walking through all assets and checking for any links back to them.

WARNING: This script does not take into account assets that are only linked inside of Text fields. If you primarily embed images directly using the markdown editor, this will very likely delete assets you depend on.

You must fill in your own CMA access token & space ID at the top before running

Usage

@imshuffling
imshuffling / jquery-focus-maxlenth.js
Created January 24, 2019 15:01
jQuery, focus() to next input field, based on input maxlength attribute
$(document).ready(function(){
$(".giftcardCodeChecker .numbers input").on('input', function () {
if($(this).val().length == $(this).attr('maxlength')) {
$(this).next().focus();
}
});
});
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>