Skip to content

Instantly share code, notes, and snippets.

View iocron's full-sized avatar

Sebastian P. iocron

View GitHub Profile
@iocron
iocron / gist:ae04b09bb2aafa7109e28dfec955bc04
Created December 8, 2023 17:56
YouTube AdBlock (save this as bookmark and click on it once a youtube ad starts)
javascript:(function(){ function clickButton() { const button = document.querySelector('#skip-button\\:5%20>%20span%20>%20button');%20if%20(button)%20{%20button.click();%20}%20}%20function%20adjustPlaybackForAds(target)%20{%20if%20(target.classList.contains('ad-showing')%20||%20target.classList.contains('ad-interrupting'))%20{%20const%20video%20=%20document.querySelector('video');%20if%20(video)%20video.playbackRate%20=%2016;%20}%20}%20function%20waitForVideoAndObserve()%20{%20const%20video%20=%20document.querySelector('video');%20if%20(video)%20{%20video.playbackRate%20=%2016;%20video.autoplay%20=%20true;%20video.muted%20=%20true;%20const%20player%20=%20document.querySelector('ytd-player%20#movie_player[aria-label="YouTube%20Video%20Player"]');%20if%20(player)%20{%20const%20observer%20=%20new%20MutationObserver(mutations%20=>%20{%20mutations.forEach(mutation%20=>%20{%20if%20(mutation.type%20===%20'attributes'%20&&%20mutation.attributeName%20===%20'class')%20{%20clickButton();%20adjustPlaybackForAds(mutation.
@iocron
iocron / getDateCustom.js
Last active November 23, 2022 12:51
getDateCustom
// Description: Function to create custom date string in format "hh:mm dd-mm-yyyy"
// Usage (current time): getDateCustom()
// Usage (custom local time): getDateCustom("2022-01-01T01:01:01")
// Usage (custom universal time): getDateCustom("2022-01-01T01:01:01Z")
function getDateCustom(date) {
const _today = typeof date == "undefined" ? new Date() : new Date(date)
const _year = _today.getFullYear()
const _month = `${_today.getMonth()+1}`.padStart(2, "0")
const _day = `${_today.getDate()}`.padStart(2, "0")
const _hour = `${_today.getHours()}`.padStart(2, "0")
@iocron
iocron / TYPO3 Nginx Config
Last active November 27, 2022 19:01
TYPO3 Nginx Config
# TYPO3 Nginx Config
# Add to your plesk domain nginx directives or edit your nginx sites conf directly (e.g.: /etc/nginx/sites-available/example.com)
# (please check out t3planet https://t3planet.com/blog/typo3-nginx/#c14024 for more informations)
# Compressing resource files will save bandwidth and so improve loading speed especially for users
# with slower internet connections. TYPO3 can compress the .js and .css files for you.
# *) Set $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel'] = 9 for the Backend
# *) Set $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] = 9 together with the TypoScript properties
# config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files.
@iocron
iocron / index.html
Created May 20, 2019 23:27
CSS Triangle Overlay // source https://jsbin.com/vijozob
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="CSS Triangle Overlay - Compatible with IE9+,FF,Chrome,Safari">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>CSS Triangle Overlay</title>
<style id="jsbin-css">
*{ margin:0; }
body { background:#eee; }
@iocron
iocron / gist:2d0e69f2eba2f4150e80
Last active August 29, 2015 14:24 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*