Skip to content

Instantly share code, notes, and snippets.

View mehedithedue's full-sized avatar

Mehedi Hassan mehedithedue

View GitHub Profile
/*
"react-dnd": "^5.0.0",
"react-dnd-html5-backend": "^3.0.2",
"react-beautiful-dnd": "^13.0.0",
*/
import { DragDropContext, Draggable, Droppable } from "react-beautiful-dnd";
function PopularTags({
tags,
existingPopularTag,
@mehedithedue
mehedithedue / mujib_borsho_countdown_timer.js
Last active January 19, 2020 09:46
This is a mujib borsho countdown timer
(function () {document.write('<style>@font-face{font-family: "SolaimanLipi";url("https://www.omicronlab.com/download/fonts/SolaimanLipi_20-04-07.ttf") format("truetype"), font-weight: normal; font-style: normal}@media only screen and (min-width: 992px){.mujib_borsho_slogan{margin: 4.5% 0 0 0; font-size: 22px; line-height: 1.1; color: #46600c; text-align: right}small.time-title{font-size: 12px; color: #46600c}#mujib_borsho_countdown_days, #mujib_borsho_countdown_hours, #mujib_borsho_countdown_minutes, #mujib_borsho_countdown_seconds{font-family: SolaimanLipi, sans-serif !important; color: #115214; font-size: 30px}#mujib_borsho_bat ul#mujib_borsho_list li{padding: 1px !important}}@media only screen and (max-width: 480px){.mujib_borsho_slogan{font-size: 16px; color: #3f6d05}}@media only screen and (max-width: 600px){.mujib_borsho_slogan{font-size: 17px; color: #3f6d05}.mujib_borsho_slogan #slogan_arrow{display: none}ul#mujib_borsho_list li{padding: 0}#mujib_borsho_countdown_days, #mujib_borsho_countdown_hours, #
@mehedithedue
mehedithedue / Download all mp4 file from url
Created November 14, 2019 10:09
Download all mp4 file from a url and save in destination folder by Python
from bs4 import BeautifulSoup
import wget
import requests
import os
url = 'http://canvas.projekti.info/laracast/%20Intermediate%20Laravel/'
ext = 'mp4'
destinationFolder = "/home/mehedi/Downloads/intermediate_laravel/"
@mehedithedue
mehedithedue / Datatable Reload on Select Option JS
Created April 7, 2019 06:01
Datatable Reload on Select Option or other and Server side code with Laravel Yajra
function getDatatable(parameter = null) {
var token = $('input[name="_token"]').val();
$('#datatable').DataTable({
iDisplayLength: 25,
processing: true,
serverSide: true,
searching: true,
ajax: {
@mehedithedue
mehedithedue / Where (OR AND) by Closure Laravel
Last active April 7, 2019 05:28
Where (OR AND) by Closure Laravel Eloquent ORM
$variable = Modal::where(function ($query) use ($info) {
$query->where('column_one', $info)
->orWhere('column_two', $info)
->orWhere('status', 3);
})
->where('deleted', 0)
->first();
@mehedithedue
mehedithedue / Logical Condition in Where Laravel
Last active April 7, 2019 05:29
Logical conditional query in where clause in Laravel ORM
Model::leftJoin('dummy_table', 'dummy_table.id', '=', 'mock_table.foreign_key')
->where('dummy_table.status', 1)
->where(function ($query) {
$users = Auth::user()->id;
if ($users == '12') {
$query->where('dummy_table.created_by', '=', Auth::user()->id)
->where('dummy_table.user_group', 'user');
} else if (in_array($users, [1, 4, 6])) {
$query->whereIn('dummy_table.created_by', [1, 4, 6]);
} else {
mysql> select * from product_category;
+-----------+----------------+---------------------+
| id | category_id | product_id |
+-----------+----------------+---------------------+
| 1 | 1 | 2 |
| 2 | 2 | 2 |
| 3 | 3 | 2 |
| 4 | 2 | 3 |
| 5 | 2 | 4 |
| 6 | 3 | 4