Skip to content

Instantly share code, notes, and snippets.

Working from home

Jan Küster jankapunkt

Working from home
View GitHub Profile
jankapunkt / yt-hide-consent.js
Created Sep 10, 2020
Greasemonkey UserScript Youtube hide consent panel
View yt-hide-consent.js
jankapunkt /
Last active Mar 18, 2020
Update Meteor core + packages + npm outdated packages
#!/usr/bin/env bash
# Author: Jan Küster
# License: MIT
# Description:
# This optional script checks for the updated files related to
# the update script and commits their changes using some default messaged.
# -----------------------------------------------------------------------------
# Step 4: check for changed files and create respective commit messages
# -----------------------------------------------------------------------------
jankapunkt /
Created Aug 19, 2019
Initializes a new repo and merges it with a new origin
#!/usr/bin/env bash
# init repo and initially add all files
# ignore should exist before already
git init
git add -A
git commit -a -m "initial files added"
# add the new remote and merge them
git remote add origin $1
jankapunkt / circular.js
Last active Jul 10, 2019 — forked from lukas-zech-software/circular.js
Detect circular references in objects
View circular.js
export const isCircular = target => {
const map = new WeakMap()
const detect = obj => {
if (obj === null || typeof obj !== 'object') return false
if (map.get(obj)) return true
map.set(obj, true)
return Object.values(obj).some(objProp => detect(objProp))
return detect(target)
jankapunkt / command.css
Last active Jan 18, 2019
Javascript command pattern example. Put this in your fiddle, code pen or other online editor and run it. Supports undo and redo.
View command.css
body {
font-family: 'Helvetica', 'Arial', 'Sans Serif';
pre {
background-color: #ddd;
padding: 4px;
code {
jankapunkt / isObject.js
Last active Jan 24, 2018
Approach to get a full working isObject test in JavaScript
View isObject.js
* Returns true, if x is a pure Object (not a descendant of Object)
* Test cases:
* assert.isFalse(isObject(''));
* assert.isFalse(isObject('abc'));
* assert.isFalse(isObject([]));
* assert.isFalse(isObject([1,2,3]));
* assert.isFalse(isObject(1));
* assert.isFalse(isObject(1.4));
* assert.isFalse(isObject(function () {}));
jankapunkt / babel_build.js
Created Mar 3, 2017
Multiplatform babel build
View babel_build.js
The MIT License
Copyright 2017 Jan Küster <>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,