Skip to content

Instantly share code, notes, and snippets.

View qb20nh's full-sized avatar
💭
I may be slow to respond.

Yoo Taejong qb20nh

💭
I may be slow to respond.
  • 17:28 (UTC +09:00)
View GitHub Profile
@qb20nh
qb20nh / migrate-docker-volume.sh
Created May 4, 2023 09:49 — forked from funkyfisch/migrate-docker-volume.sh
Migrate a docker volume from one host to another
#!/bin/bash
# Environment check
# If migrating from localhost, set this to localhost
if [[ ! $SOURCE_HOST_ADDRESS ]]
then
echo "Please set the current host address in SOURCE_HOST_ADDRESS"
exit 1
fi
@qb20nh
qb20nh / intercept-function.js
Last active December 11, 2021 12:39 — forked from tilmanschweitzer/intercept-function.js
Function to intercept functions calls even to nativ functions.
const interceptFunction = (object, fnName, options) => {
const noop = () => {}
const fnToWrap = object[fnName]
const before = options.before || noop
const after = options.after || noop
object[fnName] = function (...args) {
before.apply(this, args)
const result = fnToWrap.apply(this, args)
after.apply(this, args, result)