Skip to content

Instantly share code, notes, and snippets.

@sarink
sarink / docker-readme.md
Last active January 28, 2017 21:34
docker-readme

Docker for <project_name>

Overview/Things to Know

Machine

Our machine name is "<company_name>"

A docker machine is the underlying virtual machine that your container runs on. You shouldn't really ever have to worry about it.

@sarink
sarink / cloudSettings
Last active April 29, 2020 15:54
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-01T15:56:19.123Z","extensionVersion":"v3.4.3"}
@sarink
sarink / node-exec.js
Created October 6, 2020 19:45
promise-based node exec with stdout logging
const { spawn } = require('child_process');
const exec = (command, args = []) => {
return new Promise((resolve, reject) => {
console.log('');
console.log(`${command} ${args.join(' ')}`);
const proc = spawn(command, args);
proc.stdout.pipe(process.stdout);
proc.stderr.pipe(process.stderr);
@sarink
sarink / private.js
Last active December 25, 2022 21:56
// Sample demo of how to gain access to "private" variables in JavaScript,
// even if they'd normally be inaccessible due to the closure.
var Table = function () {
var _array = ["super", "secret", "message"];
return {
get: function (i) { return _array[i]; },
store: function (i,v) { _array[i] = v; },
append: function (v) { _array.push(v); }
};
};