Skip to content

Instantly share code, notes, and snippets.

View patrickxchong's full-sized avatar

Patrick Chong patrickxchong

View GitHub Profile
adactio / saveTextarea.js
Last active December 2, 2023 06:52
Put the contents of a textarea into localStorage if the user leaves the page before submitting the form.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
(function (win, doc) {
// Cut the mustard.
if (!win.localStorage) return;
// You should probably use a more specific selector than this.
var textarea = doc.querySelector('textarea');
// The key for the key/value pair in localStorage is the current URL.
var key = win.location.href;
siiramone /
Last active November 16, 2023 19:32 — forked from vladox/
Download sentry issues within the specified date range for a project. Useful for data processing.
"""Download sentry data.
1. create auth token (
2. make a directory for export if not exists.
$ mkdir data
3. fix event.timestamp (L27).
4. execute
$ python <org>/<project> <auth_token>
5. a CSV file with a name formatted as "./data/issues_YYYYmmDDHHMMSS.csv" is created.
soheilhy /
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers