View reading-time.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
// add this function to your post model; | |
// reading time | |
//The average reader reads about 200 words per minute, so I decided to have less to make estimates more accurate | |
public function postReadingTimeEstimation($averageReadsPerMunite = 180) | |
{ | |
$textOfTheBody = $this->body; | |
$totalWords = str_word_count(strip_tags($textOfTheBody)); | |
$minutes = floor($totalWords / $averageReadsPerMunite); |
View LivePreviewPureJavascript.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
/* html and css | |
<div class="card"> | |
<h1> | |
PHP Web Developer | |
</h1> | |
<span> | |
Full Time Job | |
</span> | |
</div> |
View EvenNumbersInArray.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 | |
$nums = [6, 12]; | |
function findNumbers($nums) { | |
// initialise the count | |
$count = 0; | |
foreach($nums as $num){ | |
$numLenght = strlen($num); |
View csvToXml.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 | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
$csv = []; | |
if ($_FILES['csv']['error'] == 0) { | |
$name = $_FILES['csv']['name']; | |
$ext = strtolower(end(explode('.', $_FILES['csv']['name']))); |
View csvToXml.hmtl
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"> | |
<!-- Bootstrap CSS --> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> | |
<title>SCV To XML</title> |
View Galaxy-5-target.css
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
@media only screen and (max-width: 640px) and (orientation : landscape) { | |
//your code here | |
} |
View promise.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
const myPromise = new Promise((resolve, reject) => { | |
let connection = false; | |
if (connection) { | |
resolve('Conection is OK'); | |
} else { | |
reject('conection is not OK') | |
} | |
}); |
View vue-image-slide.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
<!-- HTML --> | |
<div id="app"> | |
<a @click.prevent="prevSlide()" href="#" id="prev-slide" | |
><i class="fas fa-chevron-right"></i | |
></a> | |
<a @click.prevent="nextSlide()" href="#" id="next-slide" | |
><i class="fas fa-chevron-left"></i | |
></a> | |
<div class="col-md-12 p-0 slide"> | |
<div v-for="slide in [currentSlider]" :key="slide.id"> |
View text_to_downlable_image.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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Text To Downloadable Image</title> | |
<link | |
rel="stylesheet" | |
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" | |
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" |
View show-hide-password.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
<!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>Show/hide Password</title> | |
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.js"></script> | |
</head> | |
<body> |
NewerOlder