commit cf7e1011f6e095754cfe59cdd324f29c6da684f0 parent 6507ba42a502aef91b176bdbc449d6f7259b970c Author: Yohanes Bandung Bondowoso <hi@ybbond.dev> Date: Thu, 2 Jul 2020 19:57:57 +0700 add Boop script, modified +org.el, .zshrc Diffstat:
| A | .config/boop/hex2rgb.js | | | 44 | ++++++++++++++++++++++++++++++++++++++++++++ |
| M | .doom.d/+org.el | | | 2 | ++ |
| M | .zshrc | | | 2 | +- |
3 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/.config/boop/hex2rgb.js b/.config/boop/hex2rgb.js @@ -0,0 +1,44 @@ +/** + { + "api":1, + "name":"HEX2RGB", + "description":"Convert colors in hexadecimal to RGB.", + "author":"Yohanes Bandung Bondowoso", + "icon":"table", + "tags":"flip" + } + **/ + +function main(input) { + const items = input.text.split("\n"); + const convertedItems = items.map((item) => { + if (item) { + return makin(item); + } else { + return item; + } + }); + input.text = String(convertedItems.join("\n")); +} + +function makin(input) { + R = hexToR(input); + G = hexToG(input); + B = hexToB(input); + + return `rgb(${R.toString()}, ${G.toString()}, ${B.toString()})`; +} + +function hexToR(h) { + return parseInt(cutHex(h).substring(0, 2), 16); +} +function hexToG(h) { + return parseInt(cutHex(h).substring(2, 4), 16); +} +function hexToB(h) { + return parseInt(cutHex(h).substring(4, 6), 16); +} +function cutHex(h) { + return h.charAt(0) == "#" ? h.substring(1, 7) : h; +} + diff --git a/.doom.d/+org.el b/.doom.d/+org.el @@ -96,6 +96,8 @@ (use-package! org-journal :bind ("C-c n j" . org-journal-new-entry) + ("C-c b" . org-journal-previous-entry) + ("C-c f" . org-journal-next-entry) :config (setq org-journal-dir "~/Library/Mobile Documents/com\~apple\~CloudDocs/Notes/journals/" org-journal-date-prefix "#+title: " diff --git a/.zshrc b/.zshrc @@ -242,7 +242,7 @@ zplugin light zdharma/fast-syntax-highlighting zplugin light denysdovhan/spaceship-prompt -export NVM_DIR="$HOME/.nvm" +# export NVM_DIR="$HOME/.nvm" # export NVM_COMPLETION=true # export NVM_LAZY_LOAD=true # export NVM_LAZY_LOAD_EXTRA_COMMANDS=('nvim')