Skip to content

Instantly share code, notes, and snippets.

View kbtz's full-sized avatar
:shipit:

kbtz

:shipit:
  • Freelance
  • Remote
View GitHub Profile
@kbtz
kbtz / lnx
Last active January 22, 2024 07:18
lnx
#!/bin/bash
# A npm link alternative that avoids duplication of shared dependencies.
#
# It will install a packed version of your local package instead of just soft linking
# the package directory (which would include its own node_modules in dependency resolution).
#
# Another advantage is that only files that would be published are included in the packed version,
# then these extracted files are replaced with links to their original files.
# Hard links are used since many module resolution and bundling tools might try to resolve
# soft links to their real paths.
@kbtz
kbtz / .block
Created January 21, 2018 23:18 — forked from TennisVisuals/.block
d3v4 reusable updateable global mashup
license: mit
@kbtz
kbtz / .block
Created January 16, 2018 01:11 — forked from mbostock/.block
Brush Snapping II
license: gpl-3.0
@kbtz
kbtz / README.md
Last active October 10, 2017 21:11
Debug webpack config written in TypeScript using ts-node and Chrome Devtools

Just pipe the output of any node process with node-inspector enabled to the inspector function, it will generate a link to connect to the current debugging session...

node --inspect 2>&1 | inspector

You'd better use --inspect-brk instead of --inspect to pause at the first line so you can connect to the inspector first.

To debug my webpack.config.ts I use:

@kbtz
kbtz / GitKraken installer for fedora
Last active September 3, 2017 03:55 — forked from aelkz/[FEDORA] gitkraken
How to install gitkraken on Fedora 25 + launcher icon
#!/bin/bash
if [ ${USER} == "root" ]; then
echo "Don't run the entire script as root;" >&2
exit 1
fi
# Alternative link for icon file https://drive.google.com/file/d/0B-3KQ_ohu-RFVkJyS1Zfa2NLSVE/view
ICON="http://img.informer.com/icons_mac/png/128/422/422255.png"
@kbtz
kbtz / ensure-visibility.js
Last active March 14, 2017 02:37
Makes sure a given element is in the visible area of its scroll container;
function ensureVisibility(e, c) {
let e0 = e.offsetTop
let eD = e.clientHeight
let e1 = e0 + eD
let c0 = c.scrollTop
let cD = c.clientHeight
let c1 = c0 + cD
let visible = e0 > c0 && e1 < c1
@kbtz
kbtz / .block
Last active February 19, 2017 01:58 — forked from mbostock/.block
Scatterplot
license: gpl-3.0
@kbtz
kbtz / d3.slider.css
Created January 17, 2017 11:34 — forked from cmdoptesc/d3.slider.css
D3: Map Timeline
.d3-slider {
position: relative;
font-family: Verdana,Arial,sans-serif;
font-size: 1.1em;
border: 1px solid #aaaaaa;
z-index: 2;
}
.d3-slider-horizontal {
height: .8em;