Skip to content

Instantly share code, notes, and snippets.

View henideepak's full-sized avatar
🎯
Focusing

Deepak Bhati henideepak

🎯
Focusing
  • DOTSQUARES GLOBAL CAPABILITY CENTER (GCC)
  • CP4-228, 229, Apparel Park, Mahal Road (Hare Krishna Marg) Jagatpura, Jaipur, Rajasthan, India 302017
View GitHub Profile
@henideepak
henideepak / How to expire Drupal commerce licences programmaticly
Created April 19, 2023 11:22
How to expire Drupal commerce licences programmaticly
function theme_preprocess_node(&$variables) {
if ($type == 'node') {
// current user role
$currentuserId = \Drupal::currentUser()->id();
// Load licenses associated with the current user.
$license_ids = \Drupal::entityQuery('commerce_license')
->condition('uid', $currentuserId)
@henideepak
henideepak / ddev logs
Last active December 15, 2022 14:24
ddev status
+ set -o errexit nounset pipefail
+ rm -f /tmp/healthy
+ DDEV_PHP_VERSION=7.4
+ DDEV_WEBSERVER_TYPE=nginx-fpm
+ '[' -n 7.4 ']'
+ update-alternatives --set php /usr/bin/php7.4
update-alternatives: using /usr/bin/php7.4 to provide /usr/bin/php (php) in manual mode
update-alternatives: warning: skip creation of /usr/share/man/man1/php.1.gz because associated file /usr/share/man/man1/php7.4.1.gz (of link group php) doesn't exist
+ ln -sf /usr/sbin/php-fpm7.4 /usr/sbin/php-fpm
+ export PHP_INI=/etc/php/7.4/fpm/php.ini
@henideepak
henideepak / Aadhaar Number validation
Created October 18, 2022 09:04
Aadhaar Number validation
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="form-group">
<label for="aadhaar_number" class="col-lg-5 control-label">Aadhaar Number&nbsp;<span style="color: red">*</span></label>
<div class="col-lg-7 ">
<input maxlength="12" type="number" class="form-control" id="aadhaar_number" name="aadhaar_no" placeholder="Aadhaar Number" required="">
<p id="aadhaar_number_op"></p>
</div>
</div>
<script>
@henideepak
henideepak / remove core.extension
Last active October 18, 2022 09:08
How to resolve missing module issue in drupal
Remove missing module
drush cdel core.extension module.MYMODULE
remove config by drush
drush config:delete commerce_shipping.commerce_shipment_type.default
@henideepak
henideepak / How to Access Website without Domain Name Assigned
Created September 9, 2022 09:56
How to Access Website without Domain Name Assigned
Follow the below steps to access the website without domain name assigned using server IP address.
Open the “hosts” file in a text editor such as Notepad or Wordpad. The location of the “hosts” file will different for
different operation system.
Windows: C:\Windows\System32\drivers\etc
Linux or Ubuntu: /etc/hosts
Mac OS X: /private/etc/hosts
@henideepak
henideepak / Wp Add Custom Theme Settings
Created September 5, 2022 09:28
Wp Add Custom Theme Settings
function.php ----------------------------------
/**
* Add Custom theme settings
*/
// create admin page
if( is_admin() ){
include_once(get_template_directory() . '/admin/settings/add_menu.php');
}
@henideepak
henideepak / JS Table Filter
Last active September 2, 2022 07:04
JS Table Filter
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>JS table filter</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body>
<input type="search" placeholder="Search Codes" class="form-control search-input" data-table="customers-list">
@henideepak
henideepak / Wordpress Make a Flexible Content envirement
Created August 1, 2022 12:51
Wordpress Make a Flexible Content envirement
************************create a template
<?php
/**
* Template Name: Pure Modules Template
*
* @Description:This is the template that only modules.
*
*/
get_header();
@henideepak
henideepak / Disable Right Click via HTML attribute
Created July 5, 2022 12:15
Disable Right Click via HTML attribute
/**
* Attribute
*/
oncontextmenu="return false"
<body oncontextmenu="return false">
<select oncontextmenu="return false">
@henideepak
henideepak / Auto refresh Page via meta tag
Created July 5, 2022 12:12
Auto refresh Page via meta tag
var meta = document.createElement('meta');
meta.httpEquiv = "refresh";
meta.content = "10;"+ window.location.href;
document.getElementsByTagName('head')[0].appendChild(meta);