962Zooming and Panning in D3 with Bounds

Standard d3.zoom, pans to infinity:

this.zoom = d3.zoom()
  .scaleExtent([1/2, 100])
  .on("zoom", () => {
    g.attr("transform", d3.event.transform)
  })

Restrict pan to visible area, adjust padding (p):

this.zoom = d3.zoom()
  .scaleExtent([1/2, 100])
  .on("zoom", () => {
    var p = 0.95, e = d3.event.transform, w = this.width, h = this.height
    e.x = Math.min(Math.max(e.x, -w * e.k * p), w * p)
    e.y = Math.min(Math.max(e.y, -h * e.k * p), h * p)
    g.attr("transform", e)
  })

Vue 2.x, D3 5.0

961A Relative Path for Vue

Create a new file, call it vue.config.js

Add:

module.exports = {
  publicPath: ''
}

This overwriting the default value of '/'.

Source: https://cli.vuejs.org/config/#publicpath

959Making a Bootable Installer for OSX

Straight from the Apple Support page: How to create a bootable installer for macOS https://support.apple.com/en-us/HT201372 High Sierra Page https://support.apple.com/en-us/HT208969 High Sierra App Store Link (hidden from standard Search) https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?ls=1&mt=12

953Changing Languages in WordPress

Install additional language: Change user language:

957Htaccess and White-listing IPs

AuthUserFile /path/to/.htpasswd
AuthName "Restricted Access"
AuthType Basic
Require valid-user
Satisfy Any
Deny from All
Allow from 123.456.78.90

Allow IP ranges:

Allow from 123.456.78
Allow from 123.456

951Making a Bootable USB Stick – for Linux – in OSX

The Manjaro Wiki suggests to make a bootable USB Stick like that:

sudo dd bs=4M if=/path/to/manjaro.iso of=/dev/sd[drive letter] status=progress oflag=sync

While this might work on Linux, it does not work with dd on OSX/Darwin. Here are the error messages:

dd: bs: illegal numeric value
bs does not understand M
multiply manually, 4M -> 4 1024 1024 -> 4194304

sudo dd bs=4194304 if=/path/to.iso of=/dev/diskNr status=progress oflag=sync

dd: unknown operand status
dd on OSX does not understand the status flag
remove status flag

sudo dd bs=4194304 if=/path/to.iso of=/dev/diskNr oflag=sync

dd: unknown operand oflag
dd on OSX does not understand the oflag oflag
remove oflag flag

sudo dd bs=4194304 if=/path/to.iso of=/dev/diskNr

dd: /dev/disk4: Resource busy
Unmount disk before use, either via umount or in Disk Utility

And here we have it:

sudo dd bs=4194304 if=/path/to.iso of=/dev/diskNr

950SSH, Keys and Cyberduck

Environment: OSX 10.15.2

Understanding ~/.ssh/config

Host test.trembl.org              # Hostname
  User trembl                     # Username
  IdentityFile ~/.ssh/trembl_rsa  # Path to Key

Before config entry:

ssh -i ~/.ssh/trembl_rsa trembl@test.trembl.org

After config entry:

ssh trembl@test.trembl.org

.ssh/config looks up the corresponding IdentityFile and applies the matching IdentityFile for user & host

Keychain Access, SSH & Cyberduck

Adding key to the ssh agent:

ssh-add -K ~/.ssh/trembl_rsa

Check, if the key is present?

ssh-add -l 

Response:

2048 SHA256:abcdefghijk trembl@Fischer.local (RSA)

This does not add the key to the Keychain Access App. Does it survive a restart, or will it only be in RAM?

Answer?

Login in via Cyberduck adds Passphrase to the Keychain Access App. Is this persistent?

948Adding a CSS Framework to Vue

In your Vue Project, add your favourite CSS Framework vis npm.

npm install tachyons --save-dev

In main.js add:

import 'tachyons/css/tachyons.min.css' 
// no need for ./../node_modules/ prefix

Adding a Static CSS File

Add style.css to /public/:

In /public/index.html reference the Style Sheet:

<link rel="stylesheet" type="text/css" href="style.css">

946Pulling a GitLab Repository with Tokens & Webhooks

Update from 864 Pulling a GitHub Repository with Tokens & Webhooks

GitLab requries a gitlab-ci-token: prefix:

$token = 'gitlab-ci-token:abcdefghijklmopq'

944Overwrite changes with git pull

git pull does not overwrite any changed files by default. If you want to overwrite - and loose - any changes, use git reset --hard origin/master.