A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$ if your browser aliases it:
~ 108 byte version
| <?php | |
| /* | |
| Plugin Name: Update row based on a custom field ID/key match | |
| Plugin URI: https://wordpress.org/support/topic/update-row-based-on-a-custom-field-idkey-match | |
| */ | |
| add_filter('really_simple_csv_importer_class', function() { | |
| return "ImporterCustomize"; | |
| }); |
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
| <?php | |
| // Based on <https://github.com/mecha-cms/x.minify> | |
| namespace x\minify\_ { // start namespace | |
| $n = __NAMESPACE__; | |
| \define($n . "\\token_boolean", '\b(?:true|false)\b'); | |
| \define($n . "\\token_number", '-?(?:(?:\d+)?\.)?\d+'); |
| /* | |
| This example shows how you can use your data structure as a basis for | |
| your Firebase security rules to implement role-based security. We store | |
| each user by their Twitter uid, and use the following simplistic approach | |
| for user roles: | |
| 0 - GUEST | |
| 10 - USER | |
| 20 - MODERATOR |
| <?php | |
| /** | |
| * NOTE: This gist is very old. You might want to check out recent forks | |
| * like this one: https://github.com/Alexlytle/Wordpress_custom_route/blob/main/Wordpress_Custom_route.php | |
| * (thanks @Alexlytle) If you have an improvement to this gist, please | |
| * post a link in a comment for others who might benefit. Thanks! | |
| * | |
| * A class to create simple custom routes. | |
| * |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
| <?php | |
| // Return http response 503 service unavailable. This is important for SEO too! | |
| $protocol = $_SERVER["SERVER_PROTOCOL"]; | |
| if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) $protocol = 'HTTP/1.0'; | |
| header( "$protocol 503 Service Unavailable", true, 503 ); | |
| header( 'Content-Type: text/html; charset=utf-8' ); | |
| header( 'Retry-After: 600' ); // 10 minutes | |
| ?> | |
| <!DOCTYPE html> | |
| <html> |
| <?php | |
| function validar_cnpj($cnpj) | |
| { | |
| $cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj); | |
| // Valida tamanho | |
| if (strlen($cnpj) != 14) | |
| return false; |
| <!-- using the truncate filter --> | |
| {% for post in site.posts limit:10 %} | |
| <h2><a href="{{ post.url }}">{{ post.title }}</a></h2> | |
| <span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span> | |
| {% if post.content.size > 2000 %} | |
| {{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node --> | |
| <a href="{{ post.url }}">read more</a> | |
| {% else %} | |
| {{ post.content }} | |
| {% endif %} |