This file contains 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
/*** | |
* DESCRIPTION: | |
* A small scraper to fetch chapters of a story from RoyalRoad.com. | |
* Give it the url of a chapter and it pulls all chapters until the end! | |
* | |
* USAGE: deno run scrape.ts <royalroad.com/fiction/x/y/chapter/x/y [text | html (default)] | |
* | |
* OUTPUT: story.[txt | html] | |
*/ |
This file contains 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
# https://github.com/dracula/dracula-theme | |
# Copy dracula_theme in ~/.moc/themes/ and select from theme menu (T) or set in config | |
# I have converted rgb to mocp format using formula : 10 * percentage (0 = 0%, 255 = 100%) | |
colordef black = 0 0 0 | |
colordef red = 741 576 976 # purple | |
colordef green = 1000 475 776 # pink | |
colordef yellow = 945 980 549 | |
colordef blue = 384 447 643 # comment | |
colordef cyan = 545 914 992 |
This file contains 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
;; I installed emacs today and wanted to bind some functions to cmd key. | |
;; That simple objective somehow ended with me noting down all default keybindings. | |
;; Sharing here so you don't have to go on this side quest like me. :) | |
;; For letters, if a corresponding capital letter is missing, | |
;; it means it calls the same function as its small case form | |
;;(global-set-key (kbd "s-`") 'other-frame) | |
;;(global-set-key (kbd "s-~") 'ns-prev-frame) | |
;;(global-set-key (kbd "s-1,2,3,4,5,6,7,8,9") ) ;; grouped together |
This file contains 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 is a quick and dirty way to make charts in HTML. | |
* | |
* I made this for an email campaign, where embedding images was cumbersome | |
*/ | |
function chart({ x_axis_values, x_axis_label, y_axis_values, y_axis_unit }) { | |
const x_axis = x_axis_values | |
.map(d => `<td style="text-align:center;vertical-align:top;font-size:8px;">${d}</td>`) | |
.join("\n"); |
This file contains 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
" Add the following in your vim config | |
function! ShowNodeResult() | |
" command to run on current buffer | |
let op = system("node", bufnr()) | |
" name of output buffer | |
let win = bufwinnr("__NODE_OUTPUT__") |