Skip to content

Instantly share code, notes, and snippets.

View Debdut's full-sized avatar
💭
Chill

Debdut Karmakar Debdut

💭
Chill
View GitHub Profile
import $ from "jquery";
import uuid from "uuid/v4";
import { sendAmplitude, sendApiMutate } from "lib/messages";
import { MutationCreateMessageArgs } from "lib/types/graphql";
import { store } from "content/store";
import createMessageGql from "./create-message.gql";
import { renderHighlights } from "./Shadow";
const NONTEXT_TAGS = [ 'SCRIPT', 'STYLE', 'IMAGE', 'VIDEO', 'AUDIO' ]
function isTextNode (node) {
return NONTEXT_TAGS.indexOf(node.tagName) === -1
}
// Inner Text Less Code, But Slower
function innerText (node) {
if (node.constructor.name === 'Text') {
return node.textContent
@Debdut
Debdut / brew.sh
Created December 4, 2021 20:19
Fix Brew in Linux
# Append this to .zshrc, .profile or .bashrc
# Add Brew bin to PATH
BREW_BIN=$(brew --prefix)/bin/
if [ -d BREW_BIN ] ; then
PATH="$PATH:$BREW_BIN"
fi
@Debdut
Debdut / find.sh
Created December 5, 2021 10:01
Find and Delete Files in Linux
find ~ -name "<pattern>" -delete
@Debdut
Debdut / vim_cheatsheet.md
Last active January 25, 2023 19:53 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

C-a       Ctrl-a 
M-a       Alt-a

General

:q        close
:w        write/saves
const sleep = (millis, throwOnAborted = false) => {
let timeout_id
let rejector
const prom = new Promise((resolve, reject) => {
rejector = throwOnAborted ? reject : _ => resolve()
timeout_id = setTimeout(() => {
resolve()
}, millis)
})
@Debdut
Debdut / github.zsh-theme
Created February 4, 2022 14:32
Github Zsh Theme
PROMPT='%{$fg[green]%}@%n %{$fg[black]%}->'
PROMPT+=' %{$fg[magenta]%}%2~%{$reset_color%} $(git_prompt_info)'
PROMPT+="%(?:%{$fg[black]%}$ :%{$fg[red]%}$ )"
PROMPT+="%{$fg[white]%}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@Debdut
Debdut / README.md
Last active March 23, 2022 20:38
Safari Like Password Generator

CLI Safari Password Generator

If you love the Safari Password generator like me, idk about you but a paaaassword like e40a2a-a97a30-860df1 looks really cute to me!

Install Instructions

  • Create a file named pass in /usr/local/bin or somewhere in $PATH
  • Copy and paste the pass.sh contents into it
  • Give it executable permssion chmod +x /usr/local/bin/pass
  • And you are done!
$ tree
.
├── HELP.md
├── lolcat.spring.iml
├── mvnw
├── mvnw.cmd
├── pom.xml
├── src
│   ├── main
<?xml version="1.0" encoding="UTF-8"?>
<!-- OPML generated by NetNewsWire -->
<opml version="1.1">
<head>
<title>Subscriptions-iCloud.opml</title>
</head>
<body>
<outline text="0x41.cf" title="0x41.cf" description="" type="rss" version="RSS" htmlUrl="https://0x41.cf/" xmlUrl="https://0x41.cf/feed.xml"/>
<outline text="A Junior VC" title="A Junior VC" description="" type="rss" version="RSS" htmlUrl="https://ajuniorvc.com/" xmlUrl="https://ajuniorvc.com/feed/"/>
<outline text="A Primer on Bézier Curves" title="A Primer on Bézier Curves" description="" type="rss" version="RSS" htmlUrl="https://pomax.github.io/bezierinfo" xmlUrl="https://pomax.github.io/bezierinfo/news/rss.xml"/>