Skip to content

Instantly share code, notes, and snippets.

View shohel's full-sized avatar

Md Hossain Shohel shohel

View GitHub Profile
@shohel
shohel / settings.json
Created May 1, 2025 09:27
PhpStorm-like Syntax Colors for VSCode
{
"workbench.startupEditor": "none",
"editor.minimap.enabled": false,
"search.mode": "reuseEditor",
"workbench.editor.enablePreview": false,
"github.copilot.nextEditSuggestions.enabled": true,
"eslint.codeActionsOnSave.rules": null,
"eslint.format.enable": true,
"eslint.run": "onSave",
"eslint.runtime": "",
@shohel
shohel / DynamicContentOptionGreeting.php
Created November 7, 2024 17:04
Add & Resolve Custom Dynamic Content Field In Exisiting Divi 5 Module
<?php
/**
* Module: DynamicContentOptionGreeting class.
*
* @package Divi
*/
use \ET\Builder\Packages\Module\Layout\Components\DynamicContent\DynamicContentElements;
if ( ! defined( 'ABSPATH' ) ) {
@shohel
shohel / divibuilder-field.jsx
Last active October 18, 2024 17:20
Divi Builder - Registering custom field for the settings
## SimpleFontSelect.jsx
```
import React from 'react';
/**
* SimpleFontSelect field component.
*
* This component is used to render warning field in the Visual Builder.
*
@shohel
shohel / remove-dozent-lms-video-sources.php
Created March 11, 2021 14:05
Remove Dozent LMS Video sources
/**
* Remomve Dozent LMS Video sources
*/
add_filter( 'dozent_video_sources', 'dozent_remove_video_source' );
function dozent_remove_video_source( $sources ){
//Remove HTML 5 Upload
@shohel
shohel / dozent-lms-modify-course-access-methods.php
Last active March 9, 2021 08:17
This will help you to update / add/ remove the course access method for Dozent LMS, FYI: Dozent LMS is a Modern, Scalable Learning Management System Plugin For WordPress
//Add this code to your course themes/activated-theme/functions.php
// Remove access methods
add_filter( 'dozent_course_access_methods', 'remove_dozent_course_access_methods' );
if ( ! function_exists( 'remove_dozent_course_access_methods' ) ) {
function remove_dozent_course_access_methods( $methods ){
if ( isset( $methods[ 'public' ] ) ) {
@shohel
shohel / php file include by dot notation
Created September 17, 2018 17:34
PHP file include by dot notation tricks for developers
/**
* Dot notation Directory access / file include
*/
/**
* @param string $file_name
*
* Without Given file extension, it will be add from function
*
@shohel
shohel / directory_permission.sh
Created February 11, 2017 16:20
The right way to directory permission for www-data in linux
First, add yourself into the group www-data
usermod -a -G www-data (your username)
Then:
chgrp www-data /home/myuser/folderA
chmod g+rwxs /home/myuser/folderA
@shohel
shohel / element-on-view-port.js
Last active January 27, 2017 11:45
Element on viewport simple jquery code
$(document).on('DOMContentLoaded load resize scroll', function(){
//Selector
var element = 'footer';
var top_of_element = $(element).offset().top;
var bottom_of_screen = $(window).scrollTop() + $(window).height();
if((bottom_of_screen > top_of_element) ){
console.log('I am In footer')
}
else {
<script>
function executeMap(x =''){
var marker, map;
function initialize() {
var myLatlng = new google.maps.LatLng(29.350578853144864, 47.98828125);
var mapOptions = {
zoom: 10,
center: myLatlng,
@shohel
shohel / select2-working-example-after-append-or-copy.html
Created September 16, 2015 10:38
Select2 working example after jquery append or copy
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>PREMEDME</title>
<link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css" rel="stylesheet" />