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
add_action('wp_enqueue_scripts', function() { | |
wp_register_script( | |
'scripts-legacy', | |
get_template_directory_uri() . '/build/scripts-legacy.js', | |
['jquery'], | |
getenv('GIT_COMMIT_SHORT_SHA'), | |
true | |
); | |
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
import { listen } from 'quicklink'; | |
import ProbaClick from 'probaclick'; | |
// Quicklink | |
window.addEventListener('load', () => { | |
listen({ | |
ignores: [(uri) => uri.includes('wp-') || uri.includes('.pdf') || uri.includes('.zip')], | |
}); | |
}); |
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
class Admin | |
{ | |
public function __construct() | |
{ | |
add_action('admin_enqueue_scripts', [$this, 'acfDeprecationStyles'], 10, 2); | |
} | |
public function acfDeprecationStyles() | |
{ | |
echo '<style type="text/css">'; |
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 | |
use WP_Rest_Cache_Plugin\Includes\Caching\Caching; | |
class WpRestCache | |
{ | |
public function __construct() | |
{ | |
add_filter('wp_rest_cache/allowed_endpoints', [$this, 'cacheEndpoints'], 10, 1); | |
add_filter('wp_rest_cache/determine_object_type', [$this, 'determinteObjectType'], 10, 4); |
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
wp_embed_register_handler('srg', '#https?:\/\/(?:www\.|player\.)?(srf|rsi|rts|rtr)\.ch\/.+(detail|video|audio).((?:.{8}-.{4}-.{4}-.{4}-.{12})|\d*)(?:.startTime=(\d*)|.*)#i', 'srgEmbedHandler'); | |
function srgEmbedHandler($matches, $attr, $url, $rawattr) | |
{ | |
return sprintf( | |
'<iframe width="560" height="315" src="https://%1$s.ch/play/embed?urn=urn:%1$s:%2$s:%3$s%4$s" allowfullscreen allow="encrypted-media"></iframe>', | |
esc_attr($matches[1]), | |
esc_attr($matches[2]) === 'audio' ? 'audio' : 'video', | |
esc_attr($matches[3]), | |
array_key_exists(4, $matches) ? esc_attr('&startTime=' . $matches[4]) : '', |
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
git clone <repourl>/repo-1.git | |
cd repo-1 | |
git remote rm origin # delete link to original repository to avoid any accidental remote changes | |
git filter-branch --subdirectory-filter dir-to-move -- --all # dir-to-move is being moved to another repo. This command goes through history and files, removing anything that is not in the folder. The content of this folder will be moved to root of the repo as a result. | |
git tag -d $(git tag -l) # remove all tags from the old repository - history should now be clean | |
git remote add master ../new-repo/ # add the link to the new repo | |
git push # the new repo has just the moved folder including the history inside |
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
a { | |
position: relative; | |
display: inline-block; | |
font-size: 2em; | |
font-weight: 800; | |
color: royalblue; | |
overflow: hidden; | |
background: linear-gradient(to right, midnightblue, midnightblue 50%, royalblue 50%); | |
background-clip: text; | |
-webkit-background-clip: text; |
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
<link rel="icon" href="/favicon.ico" /><!-- 32×32 --> | |
<link rel="icon" href="/icon.svg" type="image/svg+xml" sizes="any" /> | |
<link rel="apple-touch-icon" href="/apple.png" /><!-- 180×180 --> | |
<link rel="manifest" href="/manifest.webmanifest" /> |
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 winLoad(callback) { | |
if (document.readyState === 'complete') { | |
callback(); | |
} else { | |
window.addEventListener("load", callback); | |
} | |
} | |
winLoad(function() { | |
console.log('Window is loaded'); |
NewerOlder