Skip to content

Instantly share code, notes, and snippets.

View pascaliske's full-sized avatar
👋
Hi, what's up?

Pascal Iske pascaliske

👋
Hi, what's up?
View GitHub Profile
@pascaliske
pascaliske / pvc-migrate.sh
Last active June 29, 2022 14:08
Kubernetes PVC migration
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# usage:
# ./pvc-migrate <forward|backward> <namespace> [<source> [<dest>]]
DIRECTION="${1}"
NAMESPACE="${2}"
@pascaliske
pascaliske / direnv-with-n.md
Last active June 29, 2021 09:27
Integrate `tj/n` with `direnv`

Integrate tj/n with direnv

This gist explains how to setup direnv together with tj/n. When a node version isn't available at the moment the envrc file gets loaded the node version will be downloaded automatically. Happy coding! ☕

Step 1: Install direnv

Use Homebrew to install the direnv tool.

@pascaliske
pascaliske / temp.sh
Last active April 22, 2020 13:20
Watch Raspberry Pi temperature and display in place.
temp() {
while true; do
printf "\r$(vcgencmd measure_temp)";
sleep 1;
done;
}
@pascaliske
pascaliske / convert.md
Created September 26, 2019 12:53
Convert image file to base64 string in one line.
$ cat path/to/file.png | openssl base64 | tr -d '\n' | pbcopy
@pascaliske
pascaliske / index.js
Last active June 18, 2019 11:32
Prevent `console.log` overrides
(function (window) {
var log = window.console.log, fn = function () { return log; };
Object.defineProperty(window.console, 'log', { set: fn, get: fn });
})(window);
@pascaliske
pascaliske / index.js
Created June 18, 2019 11:32
Prevent `console.log`overrides
(function (window) {
var log = window.console.log, fn = function () { return log; };
Object.defineProperty(window.console, 'log', { set: fn, get: fn });
})(window);
@pascaliske
pascaliske / ng-serve-cpu.md
Last active June 14, 2019 07:14
Angular v8 // Serve CPU Usage

Angular v8 // High CPU Usage

The v8 update of Angular needs at least Node.js version v12+ but the library fsevents which will be hoisted in version v1.2.4 from the cli isn't compatible with v12+ yet.

$ yarn why fsevents
yarn why v1.16.0
[1/4] 🤔  Why do we have the module "fsevents"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
@pascaliske
pascaliske / .direnv.md
Last active April 9, 2019 06:15
Directory specific node versions with direnv and tj/n
@pascaliske
pascaliske / .travis.yml
Created April 8, 2019 14:42
Reproducable yarn installs in TravisCI with Greenkeeper enabled.
language: node_js
node_js:
- '11'
install:
- if [[ "$TRAVIS_PULL_REQUEST_BRANCH" == *"greenkeeper"* ]]; then yarn install; else yarn install --frozen-lockfile; fi
script:
- echo "Hello World"
@pascaliske
pascaliske / node-with-correct-permissions.md
Last active January 4, 2019 14:00
Install Node, NPM and Yarn with correct permissions and enabled SIP on macOS 10.13+.

Node, NPM, Yarn

Note: Since macOS High Sierra (10.13) the directory /usr/local/bin is not modifiable anymore (because of Apple's SIP feature). But using node and npm with sudo is not advisable.

Generally it is best practice to install node using an dedicated version manager like n or nvm. This will handle permissions correctly and allows easy upgrading / downgrading the versions.

n
  1. Install node version manager n