Skip to content

Instantly share code, notes, and snippets.

Product Designer Interactive Storyteller

Scott C. Krause neodigm

Product Designer Interactive Storyteller
View GitHub Profile
neodigm / vue_make_all_parents_relative.js
Created Nov 28, 2020
Walk through DOM making all parents position relative - Vue.js method snippet
View vue_make_all_parents_relative.js
// Vue.js Method
"doHeroClick": function( ev ){
if( oTopmenu && !oTopmenu.isMobile() ){
var eTarget = this.$refs["pdp_zoom_reveal"];
eTarget = eTarget.parentNode;
if( eTarget ){
while( eTarget.tagName !== "HTML" ){ = "relative";
eTarget = eTarget.parentNode;
View prefers_reduced_motion.js
// Grab the prefers reduced media query.
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
// Check if the media query matches or is not available.
if (!mediaQuery || mediaQuery.matches) {
} else {
View zoom.html
<section class="l-HeroZoom-Cntr">
<a :href="selectedHero" class="l-HeroZoom"
@mousemove="doHeroMouseMove" @mouseenter="doHeroMouseEnter" @mouseout="doHeroMouseOut">
<img ref="img_HeroZoom_bg" :src="selectedHero" :alt="selectedAlt">
<img ref="img_HeroZoom" :src="selectedHero">
neodigm / popover_ux_pattern.js
Created Nov 11, 2020
A popover is a transient view that shows on a content screen when a user clicks on a control button or within a defined area.
View popover_ux_pattern.js
// A popover is a transient view that shows on a content screen when a user clicks on a control button or within a defined area.
var oPopOver = (function( _w, _d, _q ){ // Popover UX pattern
let arPops = [], ePos, iOffTop=0, iOffLft=0;
return {
"init": function(){ // wire DOM events
arPops= [];
_w.addEventListener("resize", oPopOver.closeAll);
_w.addEventListener("scroll", oPopOver.closeAll);
_d.body.addEventListener("click", function( e ){ // Outside Click close
var eTarget =, bInside = false;
neodigm / hugo.html
Created Oct 24, 2020
Hugo Go Template Short code list logic
View hugo.html
{{ $dir := (.Get "dir") }}
{{ if eq $dir "" }} {{ $dir = "assets" }} {{ end }}
get all files that matches the directory name
which is passed as argument dir="" to the shortcode:
{{ $assets := .Page.Resources.Match (printf "%s/*" $dir) }}
{{ $assetdir := (printf "%s/%s" (.Page.Path | path.Dir) $dir) }}
{{ $page_resources := .Page.Resources.ByType "image" }}
neodigm / isWebGL.js
Created Oct 9, 2020
Detect WebGL 2 browser support
View isWebGL.js
var isWebGL2Available = function () { // Does this browser support WebGL 2?
try {
var canvas = document.createElement('canvas')
return !!(window.WebGL2RenderingContext && canvas.getContext('webgl2'))
} catch (e) {
return false
neodigm /
Last active Oct 1, 2020
Convert en masse all FLV videos to MP4 format (on Macbook). Credit Yu Arai.
if [ $# -eq 1 ]; then
mkdir flv
for i in `ls *.flv`
ffmpeg -y -i ${i} -vcodec libx264 -b:v ${bitrate} -ac 2 -ar 44100 -ab 128k `basename ${i} .flv`.mp4
neodigm / unprox.ps1
Created Sep 2, 2020
Windows PowerShell Script to turn off proxy server in registry
View unprox.ps1
Set-ExecutionPolicy Unrestricted
## Turn off proxy server in Windows
$reg = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
Set-ItemProperty -Path $reg -Name ProxyEnable -Value 0
View ms_ie_11_media_query.css
@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /*ms*/ }
neodigm / music-ad-blocker.js
Last active Sep 28, 2020
Automatically mute the Music player when Ads are playing and unmute when they are done (in Chrome).
View music-ad-blocker.js
/* Install: Open Chrome Dev Tools (Command+option+I on Mac). Menu > Sources > Snippets
Install: Create a new Snippet named spotADify.js, Paste this script, Save (Command+S).
Usage: Run the Snippet once each time you start the Music Web Player.
Usage: Right-Click the snippet named musicADify.js and choose Run from the drop-down.
Usage: Close Chrome Dev Tools. 🏖️ Play your Jams! 🎶
let spotADify = ( (_d, _q, _t) => {
let eS = _d.querySelector( _q ), bS = true;
if( eS ){
You can’t perform that action at this time.