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 isIE() { | |
var value = false; | |
if (window.navigator.userAgent.indexOf('Trident/') > 0) { | |
value = true; | |
} | |
return value; | |
} | |
if (isIE() !== true){ | |
$('.ie-browser-connected').remove(); |
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
/** | |
* @param string $url | |
* @return string|string[] | |
*/ | |
function force_relative_url(string $url) | |
{ | |
return str_replace(get_site_url(), '', $url); | |
} | |
/** |
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 removeDuplicates(myArr, prop) { | |
return myArr.filter((obj, pos, arr) => { | |
return arr.map(mapObj => mapObj[prop]).indexOf(obj[prop]) === pos; | |
}); | |
} |
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
/** | |
* @param WP_Post $post | |
* @return string|null | |
*/ | |
function getPictureTyre(\WP_Post $post): ?string | |
{ | |
$result = null; | |
$pathToImg = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'Large size')[0]; | |
if ($pathToImg !== null) { | |
$result = '<img src="' . $pathToImg . '" class="tyre-post-thumbnail" >'; |
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
<?php | |
/** | |
* @param string $pathToImg | |
* @return string | |
*/ | |
function toBase64(string $pathToFile): string | |
{ | |
$type = pathinfo($pathToFile, PATHINFO_EXTENSION); | |
$data = file_get_contents($pathToFile); | |
return 'data:image/' . $type . ';base64,' . base64_encode($data); |
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
$this->addSql( | |
"UPDATE matable SET slug = | |
concat( | |
lower( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( | |
replace( |
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
/** Force number in input field of Organisator phone number */ | |
let textarea = document.getElementById('event_form_author_phone'); | |
textarea.addEventListener('keydown', (e) => { | |
console.log(e.key); | |
if (['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'Backspace'].indexOf(e.key) === -1) { | |
e.preventDefault(); | |
} | |
}); |
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 Who has talked? | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Show a list of attendees to see who has already talked. Click on a name to remove it. Double click on the list to remove the overlay. | |
// @author You | |
// @match https://meet.google.com/* | |
// @grant none | |
// ==/UserScript== |