Skip to content

Instantly share code, notes, and snippets.

View felixheck's full-sized avatar
🎯
Focusing

Felix Heck felixheck

🎯
Focusing
View GitHub Profile
/**
* @function
* @private
*
* @description
* Check if passed item is an object
*
* @param {*} item The item to be checked
* @returns {boolean} The passed item is an object
*/
@felixheck
felixheck / cloudSettings
Last active September 17, 2021 08:29
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-09-17T08:29:49.148Z","extensionVersion":"v3.4.3"}
@felixheck
felixheck / behapi.js
Last active February 4, 2020 12:32
List all projects with hapi dependencies to be scoped
const glob = require('fast-glob');
const info = require( 'npm-registry-package-info' );
const paths = glob.sync('**/package.json', {
ignore: ['**/node_modules/**/package.json'],
deep: 5
});
paths.forEach(path => {
const { dependencies, devDependencies, peerDependencies } = require(`${process.cwd()}/${path}`);
@felixheck
felixheck / block.json
Last active September 13, 2019 11:33
Action Example
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Hiya, it's me, *Erna*. The next lunch date will be next Thursday.\nThat's a tiny reminder 😉.\n\nWanna join and get to know new people?:curry:"
}
},
{
"type": "actions",
@felixheck
felixheck / README.md
Created November 9, 2019 10:59
Validator

Environment Validation & Configuration

The validator (./lib/env/validator.js) is reponsible for handling and validating environment variables. The schema listed in ./lib/env/schema.js defines which variables are required, what are their defaults, which regex pattern is required and how to transform the passed values.

For this purpose the schema is an object of objects with the following properties:

  • name <string>
    Define the name of the instance variable which exposes the transformed value.
    E.g. name="port" enables access via env.port.

  • [required=false] <boolean>

@felixheck
felixheck / index.js
Last active March 29, 2020 11:54
prefetch
// ./plugins/prefetch.js
export default ({ app, store }) => {
app.router.afterEach(() => {
Object.keys(store.state)
.filter((x) => !['app', 'menu'].includes(x))
.filter((x) => !store.state[x].fetched)
.forEach((x) => store.dispatch(`${x}/list`))
})
}
@felixheck
felixheck / keybindings.json
Created November 26, 2020 14:19
VS Code Terminal Shortcuts
[
{
"key": "ctrl+alt+o",
"command": "workbench.action.openRecent"
},
{
"key": "ctrl+alt+w",
"command": "workbench.action.closeFolder"
},
{
@felixheck
felixheck / manual.md
Last active December 7, 2020 10:43
Emergency Kit
  1. Open terminal.app
    1. ⌘ + space bar
    2. Enter & select terminal.app
  2. Copy, paste & submit with enter:
    (Backups bookmarks/passwords, deletes other Chrome files that might cause the 💥)

    mkdir ~/ChromeBackUp && cp -R ~/Library/Application\ Support/Google/Chrome/Default/Bookmarks ~/ChromeBackup && cp -R ~/Library/Application\ Support/Google/Chrome/Default/databases ~/ChromeBackup/databases && rm -rf ~/Library/Application\ Support/Google/Chrome/Default

  3. Delete Google Chrome in Applications directory
    1. Open Finder
    2. Menu bar Go > Applications
  4. Download Chrome via Safari
@felixheck
felixheck / Gradient.js
Created July 25, 2023 14:01 — forked from jordienr/Gradient.js
Stripe Mesh Gradient WebGL
/*
* Stripe WebGl Gradient Animation
* All Credits to Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
* https://kevinhufnagl.com
*/