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 | |
| function is_rest_call() { | |
| $domain = $_SERVER['HTTP_HOST']; | |
| // filtered , maybe by WPML | |
| $path = explode($domain, get_bloginfo('url')); | |
| $lang_path = trailingslashit( $path[1] ); | |
| // this is /optional-subfolder/optional-language | |
| // unfiltered |
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
| # WordPress Blank Pot | |
| # Copyright (C) 2014 ... | |
| # This file is distributed under the GNU General Public License v2 or later. | |
| msgid "" | |
| msgstr "" | |
| "Project-Id-Version: MY_PROJECT\n" | |
| "POT-Creation-Date: 2012-10-05 10:50+0100\n" | |
| "PO-Revision-Date: \n" | |
| "Last-Translator: Your Name <you@example.com>\n" | |
| "Language-Team: Your Team <translations@example.com>\n" |
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($){ | |
| $.fn.input_zip = function(){ | |
| return $(this).on('keyup', function(e){ | |
| if ($(this).val().length >= 4) { | |
| $(this).attr('inputmode', 'text'); | |
| $(this).attr('type', 'text'); | |
| } | |
| else { | |
| $(this).attr('inputmode', 'numeric'); | |
| $(this).attr('type', 'tel'); |
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
| ### Website offline per request, on oct 2, 2017 ### | |
| SetEnvIf Request_URI "^/this-is-a-secret" BYPASS=bypass | |
| RewriteRule ^this-is-a-secret / [R=302,CO=bypass-redirect:1:.secret-domain.com,L] | |
| RewriteCond %{HTTP_COOKIE} bypass-redirect=1 [OR] | |
| RewriteCond %{ENV:BYPASS} ^bypass$ | |
| RewriteRule .* - [S=1] | |
| RewriteRule .* http://www.redirect-domain.com [R=301,L] |
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 | |
| [ "" = "$1" ] && echo "Je bent vergeten het bron-bestand op te geven: $0 bron.mp4" && echo "Als tweede parameter kun je een doel-bestand opgeven: $0 bron.mp4 doel.mp4" && exit 1; | |
| BRON="$1" | |
| DOEL="$i"-18fps.mp4 | |
| [ "" != "$2" ] && DOEL="$2" | |
| ffmpeg -i "$BRON" -r 18 -filter:v "setpts=(30/18)*PTS" "$DOEL" |
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 | |
| #------------------ | |
| # Extract the key, certficiate, and chain in PEM format from a PFX format file | |
| # | |
| # Must supply the input pfx file | |
| PFX_PATH="$1" | |
| if [ "${PFX_PATH}" == "" ]; then | |
| echo "Must supply pfx file path" | |
| exit 1 |
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 | |
| add_filter('opt_out_settings', function($settings) { | |
| // this will work in most sites with a plugin to use Google Analytics. | |
| $settings['id'] = autodetect_google_analytics_code(); | |
| // OR! | |
| // use this line to be sure; | |
| $settings['id'] = 'UA-1234567-89'; // <-- your analytics property code here | |
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
| update wp_posts SET post_title = REPLACE(post_title, UNHEX('e280a8'), '') WHERE post_title LIKE concat('%', UNHEX('e280a8'), '%'); | |
| update wp_posts SET post_content = REPLACE(post_content, UNHEX('e280a8'), '') WHERE post_content LIKE concat('%', UNHEX('e280a8'), '%'); |
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 | |
| function trim_deep( &$array_object_or_scalar ) { | |
| if (is_scalar($array_object_or_scalar)) { | |
| $array_object_or_scalar = trim($array_object_or_scalar); | |
| } | |
| else if (is_array($array_object_or_scalar)) { | |
| foreach ($array_object_or_scalar as &$item) { | |
| trim_deep($item); | |
| } |
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 | |
| // sent an updated nonce to the front-end on each request | |
| add_filter( 'rest_post_dispatch', function( WP_REST_Response $response, WP_REST_Server $rest, WP_REST_Request $request) { | |
| $response->header('X-WP-Nonce', wp_create_nonce( 'wp_rest' )); | |
| return $response; | |
| }, PHP_INT_MAX, 3); | |
| // wp_create_nonce relies on user-id from global user object, and authentication cookie. | |
| // both are INCORRECT after programmatic log-in or log-out. | |
| // Really, WordPress? You should do this for us! |