Easily target images with the jQuery filter function, using a Regular Expression. With this you can easily find elements that have a matching class, like ‘featured_image’ or ‘testimonial_image’.
1 2 3 4 5 6 7 8 9 10 11 12 |
// build our desired collection. // matches both $('img.featured-testimonial__image') & $('img.featured-work__image') const matches = $('img').filter(function() { return this.className.match(/__image/); }); // Do something to collection $.each(matches, function(i, item) { $item = $(item); src = $item.attr('src'); $item.attr('src', src.replace('http://', '//')); }); |
Container
1 2 3 |
<div class='box'> <div class='content'>Aspect ratio of 1:1</div> </div> |
CSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
.box { position: relative; width: 50%; /* desired width */ } .box:before { content: ""; display: block; padding-top: 100%; /* initial ratio of 1:1*/ } .content { position: absolute; top: 0; left: 0; bottom: 0; right: 0; } /* Other ratios - just apply the desired class to the "box" element */ .ratio2_1:before{ padding-top: 50%; } .ratio1_2:before{ padding-top: 200%; } .ratio4_3:before{ padding-top: 75%; } .ratio16_9:before{ padding-top: 56.25%; } |
When using your main content feed to share posts via buffer or other services, it is crucial that your feed validates cleanly.
There are always things in the generated WordPress content that can break your feed validation. Here some things to cleanup or alter your delivered feed content.
is_feed()
Check for syndication request. This tag is not typically used by users; it is used internally by WordPress and is available for Plugin Developers.
Check for feed syndication in your themes functions.php
1 2 3 |
if (is_feed()) { /.. tweaks go here ../ } |
1 2 3 4 5 6 7 8 9 |
function rss_noiframe($content) { $content = preg_replace( '/<iframe(.*)\/iframe>/is', '', $content ); return $content; } add_filter('the_excerpt_rss', 'rss_noiframe'); add_filter('the_content_feed', 'rss_noiframe'); |
1 2 3 4 5 6 7 8 9 10 |
function rss_nocomments($content) { global $post; $post->comment_status="closed"; } add_filter('the_excerpt_rss', 'rss_nocomments'); add_filter('the_content_feed', 'rss_nocomments'); |
The sizes attribute breaks feed validation, here how to clean it up.
1 2 3 4 5 6 7 8 9 |
function no_responsive_image_feeds() { add_filter( 'max_srcset_image_width', function() { return 1; } ); } add_action('rss2_head', 'no_responsive_image_feeds' ); add_action('atom_head', 'no_responsive_image_feeds' ); add_action('rss_head', 'no_responsive_image_feeds' ); |
1 2 3 4 5 6 7 8 9 |
if (is_feed()) { function feedFilter($query) { if ($query->is_feed) { $query->set('post_type','any'); } return $query; } add_filter('pre_get_posts','feedFilter'); } |
1 2 3 4 5 6 7 8 9 10 11 12 |
if (is_feed()) { function feedFilter($query) { if ($query->is_feed) { $query->set('posts_per_page','11'); } return $query; } add_filter('pre_get_posts','feedFilter'); } |
1 2 3 4 5 6 7 8 9 10 |
if (is_feed()) { function feedFilter($query) { if ($query->is_feed) { $query->set('category_name', 'my-special-cat'); } return $query; } add_filter('pre_get_posts','feedFilter'); } |
Villa Anna Speyer – Classic Bed & Breakfast offering with 3 double rooms & bathroom.
CodeCombat is a multiplayer programming game for learning how to code. The ultimate goal of CodeCombat is to bring more users into the field of computer programming by making the logic and syntax more accessible and enjoyable to learn. The end game is to educate a whole new generation of computer programmers that started their journey by slaying ogres and defending their castles from oncoming enemy hordes.
CodeCombat teaches Python, JavaScript, and other languages directly in the browser.
CodeCombat itself can be found on GitHub under the free MIT license. All the art assets (sprites, backgrounds, sound effects, etc.) can also be found on GitHub and are published under a Creative Commons CC BY 4.0 license. This allows easy use of the game artwork for projects of students.
You can subscribe online or setup a dev environment on Windows, Mac or Linux yourself. You need to be able to follow instructions and have some basic technical knowledge.
While the setup on the Mac and Linux are straight forward, Windows is the hardest to get working! (CodeCombat Wiki)
I have setup a local dev environment on my Mac for my daughter, as she does not play regularly but loves to tinker with it from time to time … learning Javascript!
Used some AppleScript magic and Automator to ease the startup of the setup when needed. The setup might vary on your end, as I am using iTerm2 as a Terminal replacement.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
on run {input, parameters} set app_name to "mongod" set user_name to "pzTV" set path_to_codecombat to "/Users/pzTV/Entwicklung/" set the_pids to (do shell script "ps ax | grep " & (quoted form of app_name) & "| grep -v grep | awk '{printf \"%d \", $1}'") do shell script ("for PID in " & the_pids & "; do kill -9 $PID; done ") tell application "iTerm2" create window with profile "Mongo" tell current window tell current session write text "cd " & path_to_codecombat & "codecombat ; ./bin/coco-mongodb" end tell end tell tell current window create tab with profile "CodeCombat" tell current session write text "cd " & path_to_codecombat & "codecombat ; npm start" end tell end tell end tell delay 15 tell application "Google Chrome" open location "192.168.1.32:3000" end tell end run |
CodeCombat is a really fun way to get into programming and keep your kids motivated.
Really love these. Highly realistic, articulated figures created with the artist in mind. Over 30 articulated joints make it easy to recreate a desired pose or action.
Voxel Builder is an open source tool that lets anyone design and edit 3D voxel (cube) models easily, right in their web browser.
You can export the voxel, print it to allow you to fold it up using paper or use it as a base model for 3D printing!
Robo 3T gives you the full power of the MongoDB shell, but also allows you to easily save, load, edit your queries, do copy/paste, view your results as JSON/trees/tables… and get a decent autocompletion!
It is cross-platform, free and open-source (GitHub repo here).
Custom theme and integration for a GREENTONIC client. GREENTONIC did the design & layout.