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
/// Several functions are derived from MDN example: | |
/// https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#examples | |
function str2ab(str) { | |
const buf = new ArrayBuffer(str.length); | |
const bufView = new Uint8Array(buf); | |
for (let i = 0, strLen = str.length; i < strLen; i++) { | |
bufView[i] = str.charCodeAt(i); | |
} | |
return buf; |
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 apt_install () { | |
which apt | |
if [[ $? > 0 ]]; then | |
echo "apt command not found. skip..." | |
else | |
sudo apt-get install -y "$@" | |
fi | |
} | |
function emacs_snap () { |
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
; This gist is derived from ng-ts-mode.el: | |
; https://gist.github.com/lesteral/007afd6f0cf2505efcacaaf640edb698 | |
; | |
; NOTE: >=emacs30 needs to rework with bundled html-ts-mode. emacs29 depends on mickynp's extra work: | |
; https://github.com/mickeynp/html-ts-mode/tree/master | |
; WARN: nested html`` fails. | |
; WARN: css`` part doesn't works yet. | |
(add-hook 'typescript-ts-mode-hook | |
(lambda () |