Skip to content

Instantly share code, notes, and snippets.

{title} (#{id})
{sourceBranch} => {targetBranch}
{description}
{approvedByList}
@zorji
zorji / auto-ts-ignore.ts
Created July 16, 2021 03:41
A script to auto add // @ts-ignore to lines with TypeScript compilation error
/**
* A script to auto add // @ts-ignore to lines with TypeScript compilation error
* Example usage:
* $ npx tsc > compilation-errors.log
* $ npx ts-node auto-ts-ignore.ts compilation-errors.log
*/
import { readFile, writeFile } from 'fs/promises'
const errorLogFile = process.argv[2]
@zorji
zorji / README.md
Created July 11, 2020 10:06
Listen Gmail embed PDF reader selected text

This is an attempt to write a Chrome extension for Gmail that can capture the user selection for further processing. document.addEventListener('selectionchange') only works for the email body but does not work for the embed Gmail PDF reader.

By inspecting the Gmail PDF reader, I tried a different way to retrieve user selection.

The current PDF reader in Gmail is in the following structure:

<html>
@zorji
zorji / reset-git-history-to-initial.sh
Last active June 23, 2019 08:15
Reset Git history to initial commit
# List all commits (across all branches) for a given file
git log --all -- path
# How to revert initial git commit? http://stackoverflow.com/a/6637891/412743
git update-ref -d HEAD
git commit -m "init commit"
@zorji
zorji / .profile
Last active March 22, 2016 10:25
ll in OS X
export PATH="/usr/local/sbin:$PATH"
ll="-alh --classify --color=auto --group-directories-first"
alias ll="gls $ll"
alias ls="gls --color=auto"
export NVM_DIR="/Users/Z/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm