Skip to content

Instantly share code, notes, and snippets.

View jlfwong's full-sized avatar

Jamie Wong jlfwong

View GitHub Profile
// http://bgrins.github.io/devtools-snippets/#console-save
var saveToFile = function(data, filename) {
if (!data) {
console.error('Console.save: No data');
return;
}
if (!filename) {
filename = 'console.json';
}

SSH forwarding for Docker Desktop for Mac which respects $SSH_AUTH_SOCK

This is a quick tutorial on how to get SSH key forwarding working on Docker Desktop for Mac in situations where you want control of which ssh-agent server is being used, rather than the default.

You might want to do this to e.g. forward a specific SSH key into a docker container.

Docker has support for general SSH key forwarding, but this doesn't respect $SSH_AUTH_SOCK.

Background on ssh-agent

@jlfwong
jlfwong / fluid-sim.js
Created December 12, 2025 17:10
fluid-sim.js
/**
* 2D fluid simulation code for
* http://jamie-wong.com/2016/08/04/webgl-fluid-simulation/
*/
window.FluidSim = function(canvasId, options) {
options = options || {};
options.initVFn = options.initVFn || [
'sin(2.0 * 3.1415 * y)',
'sin(2.0 * 3.1415 * x)'