Skip to content

Instantly share code, notes, and snippets.

View JPustkuchen's full-sized avatar

Julian Pustkuchen JPustkuchen

View GitHub Profile
@JPustkuchen
JPustkuchen / autoreload.js
Last active June 25, 2021 16:18
JavaScript jQuery Page Auto Reload Timer with enable / disable checkbox
<script>
$( document ).ready(function() {
window.setInterval(function() {
if($('#autoreload').is(':checked')){
if(('#autoreload-wrapper .countdown').length && (parseInt($('#autoreload-wrapper .countdown').text()) <= 1)){
// Reload every 60 seconds without sending POST again:
window.location.href = window.location.href;
} else {
$('#autoreload-wrapper .countdown').text(parseInt($('#autoreload-wrapper .countdown').text()) - 1);
}
; Personal Configuration for https://github.com/DanTup/BrowserSelector
; See https://julian.pustkuchen.com/en/open-specific-browser-url-open-clickup-brave
; Default browser is first in list
; Use `{url}` to specify UWP app browser details
[browsers]
ff = C:\Program Files\Mozilla Firefox\firefox.exe
chrome = C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
edge = microsoft-edge:{url}
@JPustkuchen
JPustkuchen / drupal-delete-entity-type-bundle.php
Created February 9, 2022 15:27
Drupal 8 / 9: Delete Entity Bundle ($configEntityBildText)
<?php
// Delete paragraph example_bundle bundle!
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $entity_storage */
$entity_storage = \Drupal::entityTypeManager()->getStorage('paragraphs_type');
$configEntityBildText = $entity_storage->load('example_bundle');
$configEntityBildText->delete();
?>
@JPustkuchen
JPustkuchen / drupal-active-config-key-exists.php
Last active February 9, 2022 17:52
Check if configuration with given name exists (like "has()") in active configuration.
<?php
/**
* Helper function / example code to check
* if the given configuration (by name)
* exists in active configuration.
* @param string $configName
* The id of the configuration to check.
*
* @return boolean