Skip to content

Instantly share code, notes, and snippets.

@leedongwei
leedongwei / pre-push
Created June 11, 2020 01:57
Prevent push to master branch
# This blocks pushes into `master` locally. To enforce this for everyone with access
# to your repo, you should protect the branch with repository setting on Github
#
# 1. Save this file as .git/hooks/pre-push in your repo
# 2. Run `chmod +x .git/hooks/pre-push` to turn it on
branch_blocked=master
if grep -q "$branch_blocked"; then
echo "Blocked by git pre-push. You should not push into '$branch_blocked'." >&2
exit 1
@leedongwei
leedongwei / index.html
Last active November 15, 2023 01:04
Using web workers with pdfmake.js
<html>
<head>
<title>Demo for using web workers with pdfmake.js</title>
<style>
body {
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;