Skip to content

Instantly share code, notes, and snippets.

View joelkesler's full-sized avatar

Joel Kesler joelkesler

  • Saskatoon, SK, Canada
  • 07:41 (UTC -06:00)
  • X @joelkesler
View GitHub Profile
@joelkesler
joelkesler / lazyload-nvm.sh
Last active September 10, 2025 18:52
Lazyload NVM (for bash and zsh)
#!/bin/bash
# I recomend adding this to your ~/.bash_profile and disabling the default NVM loading command
# --------------------------------------------------
# Lazyload NVM for Bash
# --------------------------------------------------
# Load NVM/Node/Ext when needed. This loads the terminal quicker
# based on https://old.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/d5ib9fs/
# --------------------------------------------------
@joelkesler
joelkesler / nvm-update.sh
Last active September 10, 2025 18:53
Update NVM to Latest Version (for Bash and Zsh)
#!/bin/bash
# I recomend adding this to your ~/.bash_profile
# Update NVM (Node Version Manager) to latest version
nvm-update(){
# This script will check and download the latest release of NVM
getLastestNVM() {
curl --silent "https://api.github.com/repos/nvm-sh/nvm/releases/latest" |
@joelkesler
joelkesler / nvm-node-upgrade.sh
Last active September 10, 2025 18:58
NVM Node Upgrade Script (for Bash and Zsh)
#!/bin/bash
# Update Node to selected version
# and reinstall previous packages
# when using NVM
#
# usage: node-upgrade 24
#
# Tips:
# - To upgrade npm to latest, also run `nvm install-latest-npm`
@joelkesler
joelkesler / iframe-on-unload.directive.ts
Last active September 9, 2025 18:27
iFrame on Unload Directive (for Angular v20 and up) - Track when an iframe url changes
import { Directive, ElementRef, OnInit, OnDestroy, inject, output } from '@angular/core';
/**
* This directive is designed to monitor iframe navigation or reloads by listening to the `unload` event
* on the iframe's `contentWindow`. It emits an `iframeUnload` output event, allowing parent components
* to react to changes in the iframe's content.
*
* Note: Due to cross-origin restrictions, the directive may not work if the iframe loads content from
* a different domain. In such cases, a warning is logged to the console.
*
@joelkesler
joelkesler / update-angular-and-nx.sh
Created July 31, 2025 21:34
Shell Script to auto-update NX and Angular, plus selected dependancies
#!/bin/bash
set -e # Exit on error
#
# Script created by Joel Kesler - https://github.com/joelkesler
#
# By default, it will update/upgrade Angular v20.
# You can control which version you'd like to use by editing the variable below
# or running the script with the version number selected (for example v19):
#
@joelkesler
joelkesler / index.html
Last active January 11, 2022 01:50
Imperative vs Declarative Programming Tests #jsbench #jsperf - https://www.youtube.com/watch?v=E7Fbf7R3x6I (http://jsbench.github.io/#95dbcce7935934070ca21b69ea2883bc) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Imperative vs Declarative Programming Tests #jsbench #jsperf - https://www.youtube.com/watch?v=E7Fbf7R3x6I</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@joelkesler
joelkesler / accent-multitrack-player-let-it-snow.markdown
Created December 2, 2021 22:06
Accent Multitrack Player - Let it Snow

Keybase proof

I hereby claim:

  • I am joelkesler on github.
  • I am joelkesler (https://keybase.io/joelkesler) on keybase.
  • I have a public key whose fingerprint is A941 1ED2 C373 2539 7BA9 BB4B 61C1 F0FA 222A C0BE

To claim this, I am signing this object:

@joelkesler
joelkesler / gist:9635169
Created March 19, 2014 03:52
.bash_profile
asd() {
cat <<"EOT"
_ _ _
| | | | (_)
_ __ ___ __ _ ___| |__ ___ ___ | | __ __ _ _ _ __
| '_ ` _ \ / _` |/ __| '_ \ / _ \ / _ \| |/ / / _` | | '__|
| | | | | | (_| | (__| |_) | (_) | (_) | < | (_| | | |
|_| |_| |_|\__,_|\___|_.__/ \___/ \___/|_|\_\ \__,_|_|_|
EOT
#!/bin/bash
# +----------------------------------------------------------------------+
# | |
# | Set up Mac OS X to store temporary files in RAM rather than on disk.|
# | |
# | By Philipp Klaus <http://blog.philippklaus.de> |
# | |
# | Originally by Ricardo Gameiro <http://blogs.nullvision.com/?p=357> |
# | Changes by Daniel Jenkins |