Skip to content

Instantly share code, notes, and snippets.

View liuliangsir's full-sized avatar
💻
Coding

流浪大法师 liuliangsir

💻
Coding
View GitHub Profile
@winuxue
winuxue / puppeteer-ubuntu-1804.md
Created May 22, 2019 01:15
Solution for common dependences issues using puppeteer in ubuntu 18.04 (Bionic)

puppeteer dependeces in ubuntu 18.04 (Bionic)

error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

sudo apt-get install libnss3

error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

sudo apt-get install libxss1
@Gustavo-Kuze
Gustavo-Kuze / force-ctrl-c-v.md
Last active May 16, 2025 10:07
Enable copy and paste in a webpage from the browser console
javascript:(function(){
  allowCopyAndPaste = function(e){
  e.stopImmediatePropagation();
  return true;
  };
  document.addEventListener('copy', allowCopyAndPaste, true);
  document.addEventListener('paste', allowCopyAndPaste, true);
  document.addEventListener('onpaste', allowCopyAndPaste, true);
})(); 
@bradtraversy
bradtraversy / vsc_js_snippets.json
Last active April 14, 2025 18:52
VSCode JavaScript Snippets
{
"Console Log": {
"prefix": "cl",
"body": "console.log($1);",
"description": "Console Log"
},
"Named Function": {
"prefix": "nfn",
"body": ["function ${1:functionName}($2) {", " $3", "}"],
"description": "Named Function"
@lhorie
lhorie / longest-keyword-sequence.md
Last active November 13, 2024 04:15
What's the longest keyword sequence in Javascript?
@ireade
ireade / sw.js
Last active May 28, 2024 19:17
Handle broken images with the service worker
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open("precache").then((cache) => cache.add("/broken.png"))
);
});
function isImage(fetchRequest) {
return fetchRequest.method === "GET" && fetchRequest.destination === "image";
}
@miguelmota
miguelmota / tmux.conf
Created November 24, 2018 07:40
Tmux fix reattach-to-user-namespace unsupported new OS error
# how to fix the error:
# warning: reattach-to-user-namespace: unsupported new OS, trying as if it were "10.10" Mojave
# replace
bind-key -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
# with
bind-key -T copy-mode 'y' send -X copy-pipe-and-cancel "pbcopy"
@samoshkin
samoshkin / postman_vs_insomnia_comparison.md
Created November 6, 2018 17:42
Comparison of API development environments: Postman vs Insomnia

Postman vs Insomnia comparison

Postman | API Development Environment https://www.getpostman.com
Insomnia REST Client - https://insomnia.rest/

Features                                        Insomnia Postman Notes
Create and send HTTP requests x x
Authorization header helpers x x Can create "Authorization" header for you for different authentication schemes: Basic, Digest, OAuth, Bearer Token, HAWK, AWS
@zbeekman
zbeekman / GH-CF-strict-SSL-w-CDN.md
Last active May 17, 2025 03:50
Setting up GH-pages with custom domain, strict (end-to-end) SSL with CloudFlare DNS & CDN

Custom domains, GH-pages, Cloudflare and strict SSL end-to-end encryption

Why I wrote this

Before Github supported SSL encryption for github pages sites, many people were using CloudFlare (CF) as their DNS provider and CDN proxy. CF allowed users to enable SSL encryption from the CDN end points/proxies to the end user. This was great and it allowed visitors to your website to connect with a secure connection between their browser and the cloudflare CDN box that was serving your content. However, with this setup one (significant) link in the chain remained unencrypted and

@miguelmota
miguelmota / wasm_tools_install.sh
Created August 28, 2018 20:55
macOS install WebAssembly (WASM) tools (wasm-objdump)
git clone --recursive https://github.com/WebAssembly/wabt
cd wabt
make
make clang-debug
make gcc-i686-release
make clang-debug-lsan
make gcc-debug-no-re2c
chmod +x bin/
@Dalalibera
Dalalibera / custom-font-in-javascript-canvas.markdown
Created August 28, 2018 19:15
Custom Font in Javascript Canvas