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 / $(function() { ... });
Created March 31, 2022 07:22
$(function() { ... });
$(function() { ... });
is just jQuery short-hand for
$(document).ready(function() { ... });
@henideepak
henideepak / Ajax Response syntax
Last active October 18, 2022 09:05
Ajax Response syntax
$.ajax() jquery function
Jquery ajax method takes following arguments:
a url to make a call
a method name
a response type
form data to send
Following is full syntax used for ajax method:
@henideepak
henideepak / .gitignore doesn't ignore files
Created February 7, 2022 07:59
.gitignore doesn't ignore files
gitignore file
git update-index --assume-unchanged .htaccess
To revert back:
git update-index --no-assume-unchanged .htaccess
@henideepak
henideepak / Drupal 9 one time login url
Created January 8, 2022 09:44
Drupal 9 one time login url
$account = User::load(\Drupal::currentUser()->id());
$timestamp = REQUEST_TIME;
$langcode = $options['langcode'] ?? $account->getPreferredLangcode();
$reset_url = Url::fromRoute('user.reset',
[
'uid' => $account->id(),
'timestamp' => $timestamp,
'hash' => user_pass_rehash($account, $timestamp),
],
@henideepak
henideepak / Map iframe without API key
Created October 25, 2021 05:35
Map iframe without API key
<iframe
width="300"
height="170"
frameborder="0"
scrolling="no"
marginheight="0"
marginwidth="0"
src="https://maps.google.com/maps?q=-33.8569,151.2152&hl=es&z=14&amp;output=embed"
>
</iframe>
@henideepak
henideepak / Lando-Drupal9-setup-in-Linux
Created October 18, 2021 12:26
Lando Drupal9 setup in Linux
#Download Docker
Document = https://docs.docker.com/engine/install/debian/
#Lando Download
Document = https://docs.lando.dev/basics/installation.html#macos
Debian
wget https://files.lando.dev/installer/lando-x64-stable.deb
sudo dpkg -i lando-x64-stable.deb
@henideepak
henideepak / Google Map Generater
Created September 23, 2021 09:35
Google Map Generater
With Map API KEY
json code
https://maps.googleapis.com/maps/api/geocode/json?latlng=26.8828672,75.7956608&sensor=true&key=<--API KEY -->
Refrance Google url
https://developers.google.com/maps/documentation/geocoding/overview?csw=1#ReverseGeocoding
embed
<iframe src="https://www.google.com/maps/embed/v1/view?key=<--API KEY -->&center=-33.8569,151.2152&zoom=18"></iframe>
@henideepak
henideepak / How to send an email from JavaScript ?
Last active October 18, 2022 09:06
How to send an email from JavaScript ?
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<title>How to send an email from JavaScript ?</title>
</head>
@henideepak
henideepak / Dynamic bootstrap modal show
Created July 29, 2021 12:35
Dynamic bootstrap modal show
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
@henideepak
henideepak / Drupal Message Service
Last active July 29, 2021 12:42
Drupal Message Service
\Drupal::messenger()->addStatus('Cache rebuild complete.');
\Drupal::messenger()->addWarning(t('The reference view %view_name cannot be found.', ['%view_name' => $view_name]));
\Drupal::messenger()->addError(t('The user account %id does not exist.', ['%id' => $uid]));
\Drupal::messenger()->addMessage($message, 'status');
\Drupal::messenger()->addMessage($message, 'warning');
\Drupal::messenger()->addMessage($message, 'error');