Skip to content

Instantly share code, notes, and snippets.

View EMPAT94's full-sized avatar

Pritesh Tupe EMPAT94

View GitHub Profile
EMPAT94 / chart.js
Last active September 22, 2020 06:14
Hasty Charts
View chart.js
* 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>`)
EMPAT94 / quick-command.vim
Last active October 27, 2020 14:11
Quicky run an external command (eg node) on current buffer and show output in temporary vertical split
View quick-command.vim
" 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__")
EMPAT94 / emacs-mac-cmd-bindings.el
Last active May 16, 2022 07:08
All the default keybindings of cmd key in emacs!
View emacs-mac-cmd-bindings.el
;; 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
EMPAT94 / scrape.ts
Created October 13, 2023 06:25
Deno Scraper for
View scrape.ts
* A small scraper to fetch chapters of a story from
* Give it the url of a chapter and it pulls all chapters until the end!
* USAGE: deno run scrape.ts < [text | html (default)]
* OUTPUT: story.[txt | html]