Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Jan Küster jankapunkt

🏠
Working from home
Block or report user

Report or block jankapunkt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jankapunkt
jankapunkt / commit_updated_files.sh
Last active Mar 18, 2020
Update Meteor core + packages + npm outdated packages
View commit_updated_files.sh
#!/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
jankapunkt / init_add_origin.sh
Created Aug 19, 2019
Initializes a new repo and merges it with a new origin
View init_add_origin.sh
#!/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
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
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
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
jankapunkt / babel_build.js
Created Mar 3, 2017
Multiplatform babel build
View babel_build.js
/*
---------------------------------------------------------------------------
The MIT License
Copyright 2017 Jan Küster <info@jankuester.com>
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,
You can’t perform that action at this time.