Skip to content

Instantly share code, notes, and snippets.

View mingtsay's full-sized avatar
🇹🇼

Ming Tsay mingtsay

🇹🇼
View GitHub Profile
@mingtsay
mingtsay / npm_chpwd_hook.sh
Created November 9, 2020 02:09 — forked from nunofgs/npm_chpwd_hook.sh
Adds node_modules/.bin to the PATH (zsh)
if ((!$+commands[npm])); then
return 1
fi
# Adds node_modules/.bin to the PATH
npm_bin_hook() {
if [ -n "${OLDPATH+x}" ]; then
PATH=$OLDPATH
unset OLDPATH
fi
@mingtsay
mingtsay / boorkmarklet.md
Last active June 7, 2022 06:40 — forked from 71/boorkmarklet.md
Lists all participants in a Google Meet meeting.

The following bookmarket shows a popup with the name of the participants separated by comma(,) .

javascript:((n=2e3)=>{try{function h(a,b=0){if(b>7||"object"!=typeof a||null===a||a===window)return;let c=Object.getOwnPropertyDescriptors(a);for(let d in c){if(d.startsWith('["spaces/'))return Object.values(a);let e=h(c[d].value,b+1);if(void 0!==e)return e}}let i=Object.entries(window).find(a=>a[0].startsWith("closure_lm_"))[1],e=h(i),a=[];function j(b){for(let c in b){let a=b[c];if("object"==typeof a&&null!==a&&"string"==typeof a[1])return a[1]}}for(let c=0;c<e.length;c++){let f=j(e[c]);-1===a.indexOf(f)&&a.push(f)}if(0===a.length)throw new Error("Could not find any name.");a.sort((a,b)=>a.localeCompare(b));let g=a.slice(1).reduce((a,b)=>(a[0].length+b.length+1>=n?a.unshift(b):a[0]+=", "+b,a),[a[0]]).reverse();for(let b=0,{length:d}=g;b<d;b++){let k=1===d?"":" ("+(b+1)+"/"+d+")",l="Please find the list of participants below"+k+".";if(null===prompt(l,g[b]))break}}catch(m){alert("Unexpected error when runni