This file contains hidden or 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 | |
| /** | |
| * The purpose of this code is to show how you can use theme mods that will fall back to | |
| * the already-set mods of the parent theme. So, when a child theme is active, the code | |
| * checks, in the following order: 1) child theme mod, 2) parent theme mod, 3) default. | |
| */ | |
| function jt_get_theme_mod( $name, $default = false ) { | |
| if ( is_child_theme() ) |
This file contains hidden or 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
| # List the files | |
| find -E . -type f -regex ".*-[[:digit:]]{2,4}x[[:digit:]]{2,4}(@2x)?.(jpg|jpeg|png|eps|gif)" | |
| # DANGER! Delete the files | |
| find -E . -type f -regex ".*-[[:digit:]]{2,4}x[[:digit:]]{2,4}(@2x)?.(jpg|jpeg|png|eps|gif)" -delete | |
| # If your OS doesn't support -E (tip from https://github.com/quasel) | |
| find . -type f -regextype posix-extended -regex ".*-[[:digit:]]{2,4}x[[:digit:]]{2,4}(@2x)?.(jpg|jpeg|png|eps|gif)" | |
| # Improved with the help of https://github.com/markhowellsmead |
This file contains hidden or 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 | |
| # Creator: Phil Cook | |
| # Modified: Andy Miller | |
| # | |
| # >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh | |
| # >>> Kept here for legacy purposes | |
| # | |
| osx_major_version=$(sw_vers -productVersion | cut -d. -f1) | |
| osx_minor_version=$(sw_vers -productVersion | cut -d. -f2) | |
| osx_patch_version=$(sw_vers -productVersion | cut -d. -f3) |
This file contains hidden or 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]) : '', |
OlderNewer