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 | |
| toConvertFolder="to-convert/" | |
| convertedFolder="converted/" | |
| maxKhz=48000 | |
| mkdir -p $convertedFolder | |
| formats=( "aiff" "wav" ) | |
| for i in "${formats[@]}" |
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 | |
| toConvertFolder="to-convert/" | |
| convertedFolder="converted/" | |
| mkdir -p $convertedFolder | |
| # FLAC to AIFF | |
| find $toConvertFolder -type f -name "*.flac" | while read line; do | |
| newFilename="${line/%.flac/.aiff}" |
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
| svn delete http://plugins.svn.wordpress.org/plugin-slug/tags/1.0.0/ -m "Revert" --username your-username |
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 | |
| find . -type f -name "*.flac" | while read line; do | |
| newFilename="${line/%flac/aiff}" | |
| ffmpeg -y -nostdin -i "${line}" -write_id3v2 1 -c:v copy "${newFilename}" | |
| rm "${line}" | |
| done |
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
| function GI_itemHaveCheckedState(element, state, delay) { | |
| var valid = element.checked === state; | |
| if ( valid ) { | |
| if ( ! delay ) delay = 0; | |
| setTimeout(function() { | |
| element.style.outline = '5px solid rgba(98, 191, 103, 1)'; | |
| setTimeout(function() { | |
| element.style.outline = 'initial'; | |
| }, 500); | |
| }, delay); |
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
| # Prevent WP Admin from being accessed (except admin-ajax.php) | |
| #RewriteCond %{HTTP_HOST} ^(|www\.)yourdomain\.(com|net|org)$ [NC] # This line is optional, but useful if you only want to apply the rules to certain domains | |
| RewriteCond %{REQUEST_URI} ^/wp-admin/ [NC] | |
| RewriteCond %{REQUEST_URI} !^/wp-admin/admin-ajax\.php$ [NC] | |
| RewriteRule (.*) %{REQUEST_SCHEME}://%{HTTP_HOST}/ [L,R=301] | |
| # Prevent the WP login form from being accessed | |
| #RewriteCond %{HTTP_HOST} ^(|www\.)yourdomain\.(com|net|org)$ [NC] # This line is optional, but useful if you only want to apply the rules to certain domains | |
| RewriteCond %{REQUEST_URI} ^/wp-login\.php$ [NC] | |
| RewriteRule (.*) %{REQUEST_SCHEME}://%{HTTP_HOST}/ [L,R=301] |
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 | |
| /* | |
| Example usage: | |
| // The payload of the job | |
| $userQueueItem = [ | |
| 'id' => 5, | |
| 'username' => 'user', | |
| 'email' => '[email protected]', |
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 | |
| /** | |
| * Template Name: Image test | |
| * | |
| * Requires PHP version 7 >=. | |
| * | |
| * Available GET parameters: | |
| * | |
| * ?posts_per_page=5 | |
| * ?order=ASC |
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
| /** | |
| * Extract the width and height from the URL of a resized image file in Wordpress. | |
| * | |
| * @param $url | |
| * | |
| * @return array|bool | |
| */ | |
| function exctract_wordpress_image_size_from_url($url) { | |
| preg_match('/-(?P<width>[0-9]+)x(?P<height>[0-9]+).(.+)$/', $url, $matches); | |
| if ( array_key_exists('width', $matches) && array_key_exists('width', $matches) ) { |
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 | |
| // composer require jeremykendall/php-domain-parser | |
| require_once __DIR__ . '/vendor/autoload.php'; | |
| $manager = new Pdp\Manager(new Pdp\Cache(), new Pdp\CurlHttpClient()); | |
| $domain = $manager->getRules()->resolve('this.is.a.very.long.domain.co.uk'); | |
| var_dump($domain->getRegistrableDomain()); |