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
.outer { | |
position: relative; | |
&:before { | |
display: block; | |
content: ""; | |
width: 100%; | |
/* Update (1 / 1) with (width / height) for desired ratio*/ | |
padding-top: (1 / 1) * 100%; | |
} | |
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 get_recursive_files_array( $dir, $files = null ) { | |
$files_in_folder = scandir( $dir ); | |
$files = ( null === $files ) ? array() : $files; | |
foreach ( $files_in_folder as $file ) { | |
if ( ! is_dir( $dir . $file ) ) { | |
$files[] = $dir . $file; |
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
usort( $array, function( $a, $b ) { | |
if( $a['key'] === $b['key'] ) { | |
return 0; | |
} | |
return ( $a['key'] < $b['key'] ) ? 1 : -1; | |