Skip to content

Instantly share code, notes, and snippets.

View sverweij's full-sized avatar
🌪️
fighting entropy

Sander Verweij sverweij

🌪️
fighting entropy
View GitHub Profile
@sverweij
sverweij / _runme.md
Last active November 15, 2021 14:03
getting dependency metrics from dependency-cruiser

What's this?

A dependency-cruiser reporter plugin to calculate Robert C. Martin's dependency metrics with dependency-cruiser.

How do I run it?

  • copy depcruise-config-force-dependents.js and metrics-reporter-plugin.js to the working directory
  • run this:
@sverweij
sverweij / signing.md
Last active December 18, 2020 18:39
Signing commits

create a GPG keypair

gpg --full-generate-key

And follow the instructions. For e-mail address us the [email protected] from your github profile

Create an 'armor' text to paste in github profile

@sverweij
sverweij / seo-check-bookmarklet.js
Last active September 30, 2020 16:50
basic SEO element check
// bookmarklettalize with e.g. https://chimurai.github.io/bookmarklet/
/* global document */
/* eslint-disable no-console, unicorn/prevent-abbreviations, security/detect-object-injection */
function htmlCollectionToArray(pElementArray) {
let lReturnValue = [];
for (let lElement of pElementArray) lReturnValue.push(lElement);
return lReturnValue;
}
@sverweij
sverweij / remove-start-using-icloud-catalina.md
Last active June 23, 2020 20:08
Remove iCloud notification badge in preference panel (Catalina)
defaults delete com.apple.systempreferences AttentionPrefBundleIDs

Where I'm fast with upgrading most software I tend to wait out with major OSX upgrades till the kinks get ironed out. So today I set my machine to upgrade itself (took a few hours likely) and after logging on preference panel had a little nag icon. Apple apparently wants me to sign into their 'iCloud' offering. As I only use my laptop for writing code and making music (and an occasional youtube bing) I don't see the added value. I'm glad I took this long to upgrade because now there's all kinds of answers to fix it:

@sverweij
sverweij / tee.js
Created April 13, 2020 11:45
tee.js - console.log debugging for functional chains
// for console.log debugging of functional chains
const tee = (pX, pN) => {
console.error(pN, pX);
return pX;
};
// plug into chains like so
lElaborateArray
.filter(lowPass)
.map(doStuff)
@sverweij
sverweij / generate-typings-from-a-json-schema.sh
Last active October 4, 2019 21:03
Generate typings from a json schema
npx quicktype --src-lang schema --lang ts --just-types --explicit-unions YOUR_JSON_SCHEMA.json > YOUR_TYPSCRIPT_TYPOS.d.ts

Logging on

logon applid(res6) bsl testsystem.user

Create a booking in one line

node --inspect-brk x.js
and than attach the debugger thingus
@sverweij
sverweij / highlight-graphviz-edge.html
Last active August 4, 2024 10:29
Highlight an edge in a graphviz generated svg
<!-- slap this somewhere at the top -->
<style>
/* the lines within the edges */
.edge:active path,
.edge:hover path {
stroke: fuchsia;
stroke-width: 3;
stroke-opacity: 1;
}
/* arrows are typically drawn with a polygon */
@sverweij
sverweij / .dependency-cruiser.circular-only.json
Last active July 22, 2018 11:53
dependency-cruiser config with only a circular dependency check
{
"forbidden": [{
"name": "no-circular",
"severity": "error",
"from": {},
"to": { "circular": true }
}],
"options": {
"doNotFollow": "node_modules"
}