This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
-- Setup: Delay before initiating the sequence of key presses. | |
tell application "System Events" | |
delay 1 -- Delay (in seconds) allows for any preparations before the script runs. | |
-- Iterates over each character in the clipboard's content. | |
repeat with char in (the clipboard) | |
set cID to id of char -- Retrieves the ASCII value of the character for conditional handling. | |
-- Checks if the character is a number (0-9) and maps it to the corresponding key code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vanilla JavaScript function for dynamic script loading with improved caching and optional callback | |
const getScriptVanilla = async (source, callback) => { | |
try { | |
const response = await fetch(source, { | |
method: 'GET', | |
headers: { | |
'Accept': '*/*', | |
'Sec-Fetch-Dest': 'script' | |
}, | |
cache: 'force-cache' // Utilizes cache aggressively, falling back to network if unavailable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// browser detect | |
var BrowserDetect = { | |
init: function(userAgent, appVersion) { | |
this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; | |
this.version = this.searchVersion(userAgent) || this.searchVersion(appVersion) || "an unknown version"; | |
this.OS = this.searchString(this.dataOS) || "an unknown OS"; | |
}, | |
searchString: function(data) { | |
for (var i = 0; i < data.length; i++) { | |
var dataString = data[i].string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The code - first bit is all the UserAgent library. | |
(function(wndw) { | |
var Browsers, OS, Platform, Versions, browser_name, browser_version, os, platform; | |
Versions = { | |
Firefox: /firefox\/([\d\w\.\-]+)/i, | |
IE: /msie\s([\d\.]+[\d])/i, | |
Chrome: /chrome\/([\d\w\.\-]+)/i, | |
Safari: /version\/([\d\w\.\-]+)/i, | |
Ps3: /([\d\w\.\-]+)\)\s*$/i, | |
Psp: /([\d\w\.\-]+)\)?\s*$/i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cancel Webflow animations for users who prefer reduced motion | |
if (window.matchMedia("(prefers-reduced-motion)").matches) { | |
const cancelAnimationsInterval = setInterval(function() { | |
if (typeof Webflow == "undefined" || typeof Webflow.require == "undefined") { | |
return; | |
} | |
clearInterval(cancelAnimationsInterval); | |
// Get the interactions data from Webflow's state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Matthew Penkala <hello@matthewpenkala.com> | |
* @website https://matthewpenkala.com/ | |
* @version 1.0.0 | |
* @description This JavaScript file contains a function named `calculateZIndex` | |
* which, quite evidently, calculates the z-index (CSS) of a given | |
* HTML element by traversing its parents and checking the computed | |
* z-index values. The function ensures an accurate determination of | |
* the z-index even if the z-index value is specified using different | |
* units or if it's inherited from parent elements.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* DWTFYW License | |
* | |
* Author: Tony Brix, http://tonybrix.info | |
* | |
* Check if a point is within an element. | |
* Useful for mouseover on absolutely positioned overlapping elements. | |
* | |
* Example: | |
* $(document).mousemove(function(e){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(w){ | |
var arr = ['contextmenu','copy','cut','paste','mousedown','mouseup','beforeunload','beforeprint']; | |
for(var i = 0, x; x = arr[i]; i++){ | |
if(w['on' + x])w['on' + x] = null; | |
w.addEventListener(x, function(e){e.stopPropagation()}, true); | |
}; | |
for(var j = 0, f; f = w.frames[j]; j++){try{arguments.callee(f)}catch(e){}}})(window); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vanilla JavaScript - trim Leading and Trailing - ES5 | |
function TrimVanilla(str) { | |
return str.trim(); | |
} | |
// Older browsers - IE8 and before - using Polyfill. Call trim() method after running this. | |
function TrimPolyfill() { | |
if (!String.prototype.trim) { | |
String.prototype.trim = function () { | |
return this.replace(/^\s+|\s+$/g, ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
set -e | |
SIZES=" | |
16,16x16 | |
32,32x32 | |
64,64x64 | |
128,128x128 | |
256,256x256 |
NewerOlder