Skip to content

Instantly share code, notes, and snippets.

View sifat009's full-sized avatar
🎯
Focusing

sifat haque sifat009

🎯
Focusing
View GitHub Profile
@sifat009
sifat009 / countdown.html
Last active November 2, 2016 09:03 — forked from Anan5a/countdown.html
Sloved the starting with zero problem
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>RISE-Multipurpose Html Template</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#mainSection > div {
display: flex;
@sifat009
sifat009 / prefix-array.js
Last active October 20, 2018 09:52
KMP substring match(prefix array)
// KMP substring match prefix array
let string = 'aaacaaaaac';
let [i, j, strlen] = [1, 0, string.length];
let prefixArray = new Array(strlen).fill(0);
while(i <= strlen) {
if(string[i] == string[j]) {
prefixArray[i] = j + 1;
i++;
j++;
@sifat009
sifat009 / kmp.js
Created November 3, 2018 19:46
KMP algorithm implementation in javascript
// KMP substring matching algorithm
let inputString = 'this is KMP pattern matching algorithm';
let pattern = 'is';
let ans = [];
let [i, j, patternLength, strlen] = [1, 0, pattern.length, inputString.length];
let lps = new Array(patternLength).fill(0); // lowest prefix which is also a suffix
while(i <= patternLength) {
if(pattern[i] === pattern[j]) {
lps[i] = j + 1;
@sifat009
sifat009 / solution.js
Last active October 6, 2020 13:21
Extracting data from a nested structure
const course = {
data: {
chapters: [
{
title: "Chapter One",
episodes: [
{
title: "Episode One",
length: "1:06 Minutes",
vid: "VAZz_eYJJ1M",
/**
* @desc This method will provide you the available position to open your dropdown or popup
* If initial placement is "left" and if there is no available space then it'll open "right"
*
* @param {HTMLElement} targetEl The Element on which you click to open the dropdown
* @param {HTMLElement} popupEl The Dropdown element (It should be position "fixed")
* @param {String} placement The position you want to open the Dropdown
*/
[
{
"id": 1,
"name": "Best of Paris in 7 Days Tour",
"info": "Paris is synonymous with the finest things that culture can offer — in art, fashion, food, literature, and ideas. On this tour, your Paris-savvy Rick Steves guide will immerse you in the very best of the City of Light: the masterpiece-packed Louvre and Orsay museums, resilient Notre-Dame Cathedral, exquisite Sainte-Chapelle, and extravagant Palace of Versailles. You'll also enjoy guided neighborhood walks through the city's historic heart as well as quieter moments to slow down and savor the city's intimate cafés, colorful markets, and joie de vivre. Join us for the Best of Paris in 7 Days!",
"image": "https://dl.airtable.com/.attachments/a0cd0702c443f31526267f38ea5314a1/2447eb7a/paris.jpg",
"price": "1,995"
},
{
"id": 2,
const path = require('path');
const fs = require('fs');
createFolders(3);
function createFolders(depth = 0) {
solve(0);
function solve(level, folderPath = [__dirname]) {
{
"data":
{
"COURSE_TITLE": "Tutor LMS Overview: The Complete eLearning Solution",
"STUDENT_NAME": "John Doe",
"INSTRUCTOR_NAME": "Jane Doe",
"VERIFICATION_ID": "#123455",
"POINT": "100",
"GRADE": "A+",
"QR_URL": "https://www.themeum.com/product/tutor-lms/",
/**
* ℹ️ Topic: Use Proxy() to Set validation to javascript Object
* 📨 Contact for personalized training: sifathaque6@gmail.com 👈
*/
const userValidator = {
set(object, prop, value) {
const validProps = ['name', 'email'];
if (!validProps.includes(prop)) {