Skip to content

Instantly share code, notes, and snippets.

View YannMjl's full-sized avatar
💭
Learning is experience; everything else is just information!

Yann Mulonda YannMjl

💭
Learning is experience; everything else is just information!
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>XML-Jquery</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
// Do some stuff when page hmtl page is launched
$(document).ready(function () {
$("#headerTitle").hide(300).show(1500);
// calling show food menu function
showFoodMenu();
// If you want to fetch data from the file
// call fetch data function instead of showFoodMenu
// fetchData()
@YannMjl
YannMjl / bigOn.js
Last active August 12, 2019 07:46
// return true if an item exists in list
// and false if it doesn't
var fruits = ["Banana", "Orange", "Apple", "Mango"];
var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
function checkItemInList(item, list) {
return list.includes(item);
}
console.log('Is Mango in Fruit List:', checkItemInList('Mango', fruits)); // true
@YannMjl
YannMjl / bigO1.js
Last active August 12, 2019 07:46
// get the lenght of an array list
var fruits = ["Banana", "Orange", "Apple", "Mango"];
var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
function getListLenght(list) {
var _lenght = list.length;
return _lenght;
}
/* -- ****************************************************************************************
-- Device = Laptops, Desktops *
-- Screen = B/w 1025px to 1280px *
** -- ***************************************************************************************/
@media (min-width: 1025px) and (max-width: 1280px) {
/* CSS style here */
}
@YannMjl
YannMjl / box-shadow.html
Created July 5, 2019 16:23 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
// read an array of array
function readArrayOfArray() {
// This is an array of arrays.
// It is a little easier to read like this:
var arrayNumberFruit = [
[1, 'Orange'],
[2, 'Banana'],
[3, 'Apple'],
[4, 'Mango']
];
// recursive calculation of Fibonacci numbers
function fibonacci(number) {
if (number <= 1) return number;
return fibonacci(number - 2) + fibonacci(number - 1);
}
console.log(fibonacci(5));
console.log(fibonacci(6));
console.log(fibonacci(7));
// Binary Search(Iterative Approach)
var binarySearch = function (array, number) {
var start = 0;
var end = array.length - 1;
// Iterate while start not meets end
while (start <= end) {
// Find the mid index
[
{
"Name": "Paul Pogba",
"club": "Machester United",
"image": "assets/pogba.jpg"
},
{
"Name": "Luka Modrić",
"club": "Real Madrid",
"image": "assets/modric.jpg"