Skip to content

Instantly share code, notes, and snippets.

View bruceeewong's full-sized avatar
🎯
Focusing

Bruce Wang bruceeewong

🎯
Focusing
View GitHub Profile
@yokawasa
yokawasa / ghcr.md
Last active October 14, 2024 13:38
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

@Windsooon
Windsooon / leetcode_retag.md
Last active October 7, 2024 04:20
Retag most popular Leetcode problems

osjobs

海外兔

website

@yigaldviri
yigaldviri / shim-xhr-to-fetch.js
Created October 2, 2019 11:46
A shim file to replace the use of `XMLHttpRequest` with 'fetch'. Meant for supporting libraries in a service-worker's scope
class Dispatch extends EventTarget {
dispatch(eventName) {
const ev = new Event(eventName);
if (("on" + eventName) in this) {
this["on" + eventName](ev);
}
this.dispatchEvent(ev);
}
@fuzunspm
fuzunspm / client-axios.js
Last active January 15, 2024 22:54
Nestjs File download
export default class http {
async download(endpoint) {
const token = this.loadToken();
const invoice = await axios({
url: `${this.NEST_APP_IP}/${endpoint}`,
method: 'GET',
responseType: 'blob',
headers: {
Authorization: `Bearer ${token}`
}}).then((response) => {
@fearblackcat
fearblackcat / proxy_for_terminal.md
Last active November 13, 2024 04:57
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@squarism
squarism / iterm2.md
Last active November 14, 2024 08:35
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//