View Timer.js
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
export class Timer { | |
constructor() { | |
this.offset = 4692; | |
this.seconds = 0; | |
this.interval = null; | |
this.running = false; | |
this.history = [] | |
} |
View index.html
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
<a href="javascript: (function () { var jsCode = document.createElement('script'); jsCode.setAttribute('src', 'showpassword.js'); document.body.appendChild(jsCode); }());"> | |
Show hidden password | |
</a> |
View wordpress-time-to-read.php
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
<?php | |
/** | |
* Return the string with infos | |
* about the reading time of the post | |
* | |
* @return String computed reading time | |
* | |
* @author Andrea Rufo <www.andrearufo.it> | |
* @version 20210122 |
View normalize-wordpress-post-fields.php
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
<?php | |
/** | |
* Return the normalized collection of posts with custom fields | |
* @param string $type The custom post name | |
* @param array $infos The list of custom post types required | |
* @return array A collection of post object normalized | |
*/ | |
function wp_custom_post_normalized_table($type, $infos = []){ | |
global $wpdb; |
View functions-thumbnail.php
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
<?php | |
/** | |
* Return the post thumbnail url of the content (use in loop) | |
* by Andrea Rufo www.andrearufo.it | |
* | |
* @param string $size the image size registered in theme via add_image_size() function | |
* @param int $id the ID of the post | |
* @return string url of the image | |
*/ |
View flexbox.less
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
.flexbox(@d: flex, @j: center, @a: center){ | |
display: @d; | |
justify-content: @j; | |
align-items: @a; | |
display: -webkit-@d; | |
-webkit-justify-content: @j; | |
-webkit-align-items: @a; | |
} |
View fakeimg
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
<?php | |
// return the url of a random unsplash image with selected size | |
function fakeimg($w, $h, $last=495){ | |
if(!isset($h)) $h = $w; | |
return 'https://unsplash.it/'.$w.'/'.$h.'/?image='.rand(0,$last); | |
} |
View acronym
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
<?php | |
// return the acronym of a name | |
function acronym($f){ | |
$words = explode(" ", $f); | |
$acronym = ""; | |
foreach ($words as $w){ |
NewerOlder