Skip to content

Instantly share code, notes, and snippets.

View radkill's full-sized avatar
👷‍♂️
Working…

Valerii Bohdanov radkill

👷‍♂️
Working…
View GitHub Profile
@doiftrue
doiftrue / disable-comments.php
Last active July 14, 2025 02:51
[wp-kama embed] https://wp-kama.com/2539 Disable Comments for WordPress. Original code see here: https://github.com/WPDevelopers/disable-comments-mu
<?php
/**
* Plugin Name: Disable Comments (Must Use version)
* Description: Disables all WordPress comment functionality on the entire network.
* Version: 1.1.2 (changed)
* Plugin Changed URI: https://gist.github.com/doiftrue/ab931c1d866cb113b4ff318a5faeb3b3
* Plugin URI: https://github.com/WPDevelopers/disable-comments-mu
* GitHub Plugin URI: https://github.com/WPDevelopers/disable-comments-mu
* Author: WPDeveloper
* Author URI: https://wpdeveloper.com
@renakdup
renakdup / adminpanel-env-color.php
Last active March 17, 2024 12:53
Adminpanel environment color for WordPress.
<?php
/**
* Adminpanel environment color for WordPress.
* It helps to highlight environments in color. Developers, Content Managers,
* and others will never confuse the environment where they work.
*
* Author: Andrei Pisarevskii
* Author Email: [email protected]
* Author Site: https://wp-yoda.com/en/
*
@yunusga
yunusga / wpcf7.js
Created July 5, 2019 06:46
Scroll to first invalid field on Contact Form 7 validation error event
/**
* Scroll to first invalid field
* WPCF7 on validation error event
*/
document.addEventListener( 'wpcf7invalid', function( event ) {
setTimeout( function() {
$('html').stop().animate({
scrollTop: $('.wpcf7-not-valid').eq(0).offset().top - 140,
}, 500, 'swing');
}, 100);
@SilentImp
SilentImp / trashCSSLoader.js
Last active December 4, 2017 07:43
Это сверх-трешевый способ асинхронной загрузки CSS, который Google Page Speed не видит в принципе.
function trashCSSLoader(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.onload = function (response) {;
applyCSS(response.target.responseText);
};
xhr.send();
}
function applyCSS(css) {
var styles = document.createElement('style');
@bjorn2404
bjorn2404 / wp_kses_post_tags.php
Last active July 9, 2024 18:13
WordPress allow iFrames with wp_kses_post filter
<?php
/**
* Add iFrame to allowed wp_kses_post tags
*
* @param array $tags Allowed tags, attributes, and/or entities.
* @param string $context Context to judge allowed tags by. Allowed values are 'post'.
*
* @return array
*/
@john-doherty
john-doherty / javascript-trim-svg-whitespace.js
Created October 21, 2016 13:39
Trim whitespace from SVG elements
function trimSvgWhitespace() {
// get all SVG objects in the DOM
var svgs = document.getElementsByTagName("svg");
// go through each one and add a viewbox that ensures all children are visible
for (var i=0, l=svgs.length; i<l; i++) {
var svg = svgs[i],
box = svg.getBBox(), // <- get the visual boundary required to view all children
@daggerhart
daggerhart / wordpress-missing-functions.php
Created March 24, 2016 22:19
WordPress functions that I tend to write often
<?php
/**
* Get a WP_Post object by its slug ( post_name )
*
* @param $post_name
*
* @return WP_Post|null
*/
function get_post_by_slug( $post_name ) {
@spivurno
spivurno / gw-gravity-forms-change-field-id.js
Last active July 1, 2025 14:26
Gravity Wiz // Gravity Forms // Change Field ID via Browser Console
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-change-field-id.js
*/
/**
* Gravity Wiz // Gravity Forms // Change Field ID via Browser Console
*
* Provides a simple function for changing the ID of a Gravity Forms field via the browser console from the Form Editor page.
*
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active July 25, 2025 09:29
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@ValdikSS
ValdikSS / animetv.md
Last active October 25, 2020 18:09
AnimeTV

Коллективные просмотры аниме и мультиков.

Информация

Мы — компания людей, людящих смотреть аниме в компании и обсуждать его после просмотра. Чтобы присоединиться, заходите в любую из наших конференций:
XMPP / Telegram
Общайтесь и делитесь впечатлениями от просмотренного.

Коллективные просмотры анонсируются в Mastodon, в RSS-потоке, а также в конференциях.

Подключение к просмотру