Skip to content

Instantly share code, notes, and snippets.

View qwo's full-sized avatar

Stanley Zheng qwo

View GitHub Profile
@qwo
qwo / Caddyfile
Created May 22, 2022 14:39 — forked from nileshtrivedi/Caddyfile
Caddy on fly.io as reverse proxy to services on Tailscale network
log stdout
errors stdout
auto_https off
http://myapp.fly.dev {
reverse_proxy 100.120.108.62:8000
}
@nileshtrivedi
nileshtrivedi / Caddyfile
Created November 14, 2021 18:30
Caddy on fly.io as reverse proxy to services on Tailscale network
log stdout
errors stdout
auto_https off
http://myapp.fly.dev {
reverse_proxy 100.120.108.62:8000
}
const express = require('express');
const app = express();
// Application
app.get('/', function(req, res) {
if (process.env.NODE_ENV === 'development') {
for (var key in require.cache) {
delete require.cache[key];
}
}
@bonniss
bonniss / github-search-cheatsheet.md
Last active May 9, 2024 09:20
Github search cheatsheet from official docs.

Github Search Cheat Sheet

GitHub’s search supports a variety of different operations. Here’s a quick cheat sheet for some of the common searches.

For more information, visit our search help section.

Basic search

@qwo
qwo / cloudSettings
Last active May 25, 2020 17:29
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-11-15T22:05:25.530Z","extensionVersion":"v3.4.3"}
@agatsoh
agatsoh / python3.7.3_on_MX_Linux_18_1.md
Last active September 8, 2020 05:52
Install python 3.7 on MX Linux 18.1

Installing Python 3.7.3 on MX-linux 18.1

I was following this blog to install python 3.7.3 on my MX-linux 18.1 machine. Step by step procedure is as follows

  1. Install the pre-requisites

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
 libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev
@ddevault
ddevault / Makefile
Last active February 20, 2024 14:17
Tiny Wayland compositor
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
class Magic {
constructor(fn, a) {
this.__chain = [[fn, a]];
}
get(t, a) {
if (a == "✨✨MAGIC✨✨") return true;
if (a == "resolve") {
return () => Magic.chain(this.__chain);
}
return (...b) => {
@nkavadias
nkavadias / pi-hole-workshop-instructions-using-Rpi.md
Last active March 25, 2024 14:45
Raspberry Pi instructions for Pi-hole setup
@crittermike
crittermike / wget.sh
Last active March 26, 2024 22:49
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.