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
// First, set a class name inside the "Details" accordion block (because we do not have ability to set the ID) | |
// If multiple elements with the same class name are detected, the first one will be triggered | |
// Append that class name after the page URL, like so: site.domain/page/#classname | |
if(window.location.hash) { | |
var hash = window.location.hash; | |
var el = document.getElementsByClassName(hash.slice(1))[0]; | |
if(!el.hasAttribute('open')){ | |
el.setAttribute('open', ''); |
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
function sm_fix_comment_reply_passive_listeners(){ | |
// deregister inside wp_footer (and not inside init) in case other plugins try to register comment-reply after init | |
wp_deregister_script( 'comment-reply' ); | |
// Do not load JS if not needed | |
if ( is_single() && comments_open() ) { | |
?> | |
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
// Function checks if a given script is already loaded |
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
#!/bin/bash | |
# Thanks to: | |
# https://gist.github.com/erwin/a66a4c3f8a5d940ab6c434b48568ff39 | |
# https://bbs.archlinux.org/viewtopic.php?pid=1956897#p1956897 | |
# HOW TO: | |
# 1) Copy this file to /usr/local/bin/usb_reset.sh | |
# 2) make it executable: sudo chmod +x /usr/local/bin/usb_reset.sh | |
# 3) Create new service: sudo nano /etc/systemd/system/usb_reset.service |
OlderNewer