Skip to content

Instantly share code, notes, and snippets.

View engarifulislam's full-sized avatar

Ariful Islam engarifulislam

View GitHub Profile
@engarifulislam
engarifulislam / GTM Custom JavaScript - Hit Timestamp used for a Custom Dimension
Created June 22, 2022 15:30
GTM Custom JavaScript - Hit Timestamp used for a Custom Dimension
function() {
// Get local time as ISO string with offset at the end
var now = new Date();
var tzo = -now.getTimezoneOffset();
var dif = tzo >= 0 ? '+' : '-';
var pad = function(num) {
var norm = Math.abs(Math.floor(num));
return (norm < 10 ? '0' : '') + norm;
};
return now.getFullYear()
@engarifulislam
engarifulislam / jQuery click listener for Google Tag Manager
Last active December 22, 2023 18:01
jQuery Click Listener for Google Tag Manager replicating the "Click Element" and "Link Click" functionality within Google Tag Manager.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
/* jQuery is required for this script.
*/
/// load jQuery in no-conflict mode
jQuery.noConflict();
(function($) {
/// dom ready
$(function() {
$('body').on('click', function(e){
@engarifulislam
engarifulislam / contact Form 7 Submitted Listener For Google Tag Manager
Created June 22, 2022 15:26
Contact Form 7 Submitted Listener For Google Tag Manager
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
window.dataLayer.push({
"event" : "contactForm7Submitted",
"formId" : event.detail.contactFormId,
"response" : event.detail.inputs
})
});
</script>
@engarifulislam
engarifulislam / Track AJAX Form Submissions with Google Tag Manager
Created June 21, 2022 11:27
Track AJAX Form Submissions with Google Tag Manager
<script id="gtm-jq-ajax-listen" type="text/javascript">
(function() {
'use strict';
var $;
var n = 0;
init();
function init(n) {
@engarifulislam
engarifulislam / Bootstrap 3 Classes List With Description - Bootstrap Cheat Sheet.txt
Last active March 28, 2022 00:22
Bootstrap 3 Classes List With Description - Bootstrap Cheat Sheet ----
Every web developer should know how to properly code a responsive website. Bootstrap 3 is an ultimate
framework that learns you how to think when coding responsive websites and makes their creation much easier and faster.
When I was learning Bootstrap 3, I was looking for a simple list of basic Bootstrap 3 classes with description and there were none - only a few lists for Bootstrap 2, without any description, therefore pretty useless for my intentions.
Basic Bootstrap Classes
.container
sets fixed width to an element (which changes depending on a screen size to other fixed values, so it's still responsive) on all screen sizes except xs - on xs, the width is calculated automatically (this behaviour can be changed)
a fixed width responsive website should be wrapped in .container (or just the content without menu, whatever - it's up to you)
#Spring application.properties file will be database connection
spring.datasource.url=jdbc:mysql://localhost:3306/springmvc
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql= true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect