Skip to content

Instantly share code, notes, and snippets.

View mouse0270's full-sized avatar

Robert McIntosh mouse0270

View GitHub Profile
@mouse0270
mouse0270 / MudMusk.js
Created January 12, 2025 17:33
MudBlazor JS Masking using Inputmask.ks
/**
* Retrieves an HTML element by its ID.
*
* @param {string} id - The ID of the element to retrieve.
* @param {object} mask - The mask to apply to the element.
*/
window.MASK = function (id, mask) {
// Get the element by its ID
const element = document.getElementById(id);
@mouse0270
mouse0270 / rapidDefer.js
Last active January 20, 2019 16:19
Defer Inline Javascript
// With $script variable
$(document).ready(function() {
$('script[type="text/javascript/defer"]').each(function() {
var $script = $('<script type="text/javascript"/>').text($(this).clone().text());
$(this).after($script).remove();
});
});
// Without $script variable
$(document).ready(function() {
@mouse0270
mouse0270 / Dynamic Iframe - Loop
Last active January 3, 2016 20:29
iframe's with dynamic heights
// Use this if you believe the iframe may have dynamic content and could change size after it has completely loaded //
// Your Domain Name //
var parent_domain = "http://www.example.com/";
setInterval(function() {
var iframe_height = parseInt($('html').height());
// Add Padding to insure nothing is creating a scroll bar //
iframe_height += 30;