Skip to content

Instantly share code, notes, and snippets.

Avatar

Pritesh Tupe EMPAT94

View GitHub Profile
@EMPAT94
EMPAT94 / dracula_theme
Created Oct 5, 2021
Dracula color scheme for moc (Music on Console) player
View dracula_theme
# 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
@EMPAT94
EMPAT94 / emacs-mac-cmd-bindings.el
Last active May 16, 2022
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
EMPAT94 / chart.js
Last active Sep 22, 2020
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>`)
.join("\n");
@EMPAT94
EMPAT94 / quick-command.vim
Last active Oct 27, 2020
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__")