This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name youtube consent block | |
// @namespace https://*youtube.com | |
// @version 1 | |
// @include http* | |
// @grant none | |
// @license MIT | |
// ==/UserScript== | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# ----------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: 'Helvetica', 'Arial', 'Sans Serif'; | |
} | |
pre { | |
background-color: #ddd; | |
padding: 4px; | |
} | |
code { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 () {})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
--------------------------------------------------------------------------- | |
The MIT License | |
Copyright 2017 Jan Küster <[email protected]> | |
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, |