<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
First, make a new file with the following contents:
#!/usr/bin/env ruby
dirs = []
ARGF.each { |line| dirs.push(line) }
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>History popstate and hashchange Events</title> | |
<link rel="stylesheet" href="./main.css" /> | |
</head> | |
<body> |
<?php $imgPlaceholder3x2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAQAAAA3fa6RAAAAEElEQVR42mM88J8BCBghFAAfUgOBvlG2dAAAAABJRU5ErkJggg==";
if( !empty(get_the_post_thumbnail()) ) {
the_post_thumbnail( 'post-thumbnail', array(
'alt' => the_title_attribute( array(
'echo' => false,
) ),
'src' => $imgPlaceholder3x2,
'data-src' => get_the_post_thumbnail_url(),
'loading' => 'lazy',
In the past, I’ve noticed that a lot of PHP beginners tend to struggle with the foreach loop. In some cases, it is because they have arrived from a language that only supports while loops and for loops.
Here is a basic example of a foreach loop:
<?php
foreach($array as $item){
echo $item, '';
To prevent user from scrolling the screen you need to redefine touch move event:
document.ontouchmove = function(e){ e.preventDefault(); }
The easiest of these are scp or secure copy. While cp is for copying local files, scp is for remote file transfer. The main difference is that with scp you'll have to specify the remote host's DNS name or IP address and provide login credential for the command to work.
Copy single file from local to remote.
$ scp myfile.txt remoteuser@remoteserver:/remote/folder/
This file contains 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 rchv_projects_link() { ?> | |
<a class="grid_item-link gallery_item-link" href="<?php the_permalink(); ?>" aria-hidden="true" tabindex="-1"> | |
<?php $imgPlaceholder = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk2A8AAMUAwUPJ2C4AAAAASUVORK5CYII="; ?> | |
<figure class="grid_item-figure gallery_item-figure"> | |
<?php if( !empty(get_the_post_thumbnail()) ) { | |
the_post_thumbnail( 'post-thumbnail', array( | |
'alt' => the_title_attribute( array( | |
'echo' => false, | |
) ), | |
'src' => $imgPlaceholder, |
This file contains 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
let buttons = document.querySelectorAll("button"); | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of | |
// http://kangax.github.io/compat-table/es6/#for..of_loops | |
for (const button of buttons) { | |
button.addEventListener('click', () => { | |
console.log("for of worked"); | |
}); | |
} |