This file contains hidden or 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/bash | |
# Set the age threshold in seconds (7 days) | |
age=$((7 * 24 * 60 * 60)) | |
# Loop through all local branches | |
for branch in $(git for-each-ref --format='%(refname:short)' refs/heads/); do | |
# Get the timestamp of the last commit on the branch | |
timestamp=$(git log -1 --format="%ct" "$branch") |
This file contains hidden or 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
alias alogin="aws sso login --profile advanced-artefacts" | |
alias aauth='eval $(adv-do-artefacts auth --profile advanced-artefacts)' |
This file contains hidden or 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
import { h } from '@ficusjs/renderers/jsx-dom' | |
import { createCustomElement } from 'ficusjs/custom-element' | |
createCustomElement('hello-world', { | |
render () { | |
return html` | |
<p>Hello world!</p> | |
` | |
} | |
}) |
This file contains hidden or 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains hidden or 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 cache version gets updated every time there is a new deployment | |
const CACHE_VERSION = 10; | |
const CURRENT_CACHE = `main-${CACHE_VERSION}`; | |
// these are the routes we are going to cache for offline support | |
const cacheFiles = ['/', '/about-me/', '/projects/', '/offline/']; | |
// on activation we clean up the previously registered service workers | |
self.addEventListener('activate', evt => | |
evt.waitUntil( |
This file contains hidden or 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
import cryptoEs from 'https://cdn.skypack.dev/crypto-es' | |
const hash = cryptoEs.MD5("[email protected]") | |
const img = document.querySelector('img') | |
img.src = `https://www.gravatar.com/avatar/${hash.toString()}` |
This file contains hidden or 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
function getDomDepthLevel(root = document.documentElement) { | |
let pathInfo = { | |
route: [], | |
level: 0 | |
}; | |
for (let i = 0, j = root.children.length; i < j; i++) { | |
const curNodePathInfo = getDomDepthLevel(root.children[i]); | |
if (curNodePathInfo.level > pathInfo.level) { | |
pathInfo = curNodePathInfo; | |
} |
This file contains hidden or 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
const cacheName = 'blogCache'; | |
const offlineUrl = '/offline/'; | |
const adminPageSlug = '/ghost'; | |
/** | |
* The event listener for the service worker installation | |
*/ | |
self.addEventListener('install', event => { | |
event.waitUntil( | |
caches.open(cacheName) |
This file contains hidden or 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
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo "%d" && rimraf "%d" |
NewerOlder