Skip to content

Instantly share code, notes, and snippets.

soheilhy /
Last active Sep 18, 2021
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

lelandbatey /
Last active Sep 15, 2021
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


maxogden / bibtex.png
Last active Sep 13, 2021
How to make a scientific looking PDF from markdown (with bibliography)
Rich-Harris /
Last active Sep 10, 2021
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

dypsilon /
Last active Sep 3, 2021
A badass list of frontend development resources I collected over time.
View bs-config.js
module.exports = {
server: '.',
files: [
ui: false,
notify: false
mattdesl / motion-blur.js
Last active Jul 20, 2021
canvas-sketch + motion blur + canvas2D (NOTE: Only blurs on sequence export) adapted from @delucis
View motion-blur.js
// Adapted from @delucis
const canvasSketch = require('canvas-sketch');
const settings = {
dimensions: [ 512, 512 ],
duration: 3,
animate: true,
fps: 24
veltman /
Last active May 26, 2021
Generating an SVG from a set of shapefiles

Generating an SVG from a set of shapefiles

The USGS provides detailed downloads of fire perimeters, with timestamped files that can be used to show the spread of a major fire over time.

Using the 2017 Thomas fire as an example, we'll process this data into a single SVG file with all the different perimeter measurements.

This index page contains links to a series of shapefiles of the fire boundary, each one with a timestamp:

gka / multi-crowbar.js
Last active Apr 29, 2021
like svg-crowbar, but for multiple svg elements!
View multi-crowbar.js
var multiCrowbar = (function() {
* SVG Export
* converts html labels to svg text nodes
* will produce incorrect results when used with multi-line html texts
* Author: Gregor Aisch
* based on