Skip to content

Instantly share code, notes, and snippets.

View MohcinBN's full-sized avatar

Mohcin Bounouara MohcinBN

View GitHub Profile
@MohcinBN
MohcinBN / Galaxy-5-target.css
Last active May 6, 2021 21:06
Galaxy 5 640x360 resolution target CSS
@media only screen and (max-width: 640px) and (orientation : landscape) {
//your code here
}
@MohcinBN
MohcinBN / showdivfull
Last active October 8, 2018 17:00
Jquery Click to show div 100%, with css animation
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
<style>
.text {width: 40%; background: red;}
.back {display:none;}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
@MohcinBN
MohcinBN / promise.js
Created September 25, 2020 11:59
JavaScript promise example
const myPromise = new Promise((resolve, reject) => {
let connection = false;
if (connection) {
resolve('Conection is OK');
} else {
reject('conection is not OK')
}
});
@MohcinBN
MohcinBN / vue-image-slide.js
Created January 6, 2021 14:44
Vue Js Images Slide easy to understand, based on existing example on the net I just Develop and simplify it it a little
<!-- 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">
<!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"
@MohcinBN
MohcinBN / show-hide-password.html
Last active May 6, 2021 21:04
Vue Js Hide/Show Password
<!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>
@MohcinBN
MohcinBN / EvenNumbersInArray.php
Last active May 18, 2022 17:35
Find Numbers with Even Number of Digits
<?php
$nums = [6, 12];
function findNumbers($nums) {
// initialise the count
$count = 0;
foreach($nums as $num){
$numLenght = strlen($num);
@MohcinBN
MohcinBN / csvToXml.php
Created May 12, 2022 18:23
CSV to XML
<?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'])));
@MohcinBN
MohcinBN / csvToXml.hmtl
Created May 18, 2022 17:35
CSV TO XML using PHP, Ajax
<!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>
/* html and css
<div class="card">
<h1>
PHP Web Developer
</h1>
<span>
Full Time Job
</span>
</div>