Skip to content

Instantly share code, notes, and snippets.

View kartick14's full-sized avatar
🎯
Focusing

Kartick Karmakar kartick14

🎯
Focusing
  • kolkata, India
View GitHub Profile
@kartick14
kartick14 / index.html
Created March 12, 2020 15:36
Smooth Page Scrolling in jQuery
<div id="page-wrap">
<h1 id="top">Smooth Page Scrolling</h1>
<ul>
<li><a href="#two">Scroll to Section Two</a></li>
<li><a href="#three">Scroll to Section Three</a></li>
</ul>
<h2 id="one">Section One</h2>
@kartick14
kartick14 / jquery-function.html
Created November 11, 2019 06:52
Display dynamic time using jquery
Use momentjs for display dynamic time.
https://momentjs.com/docs/
@kartick14
kartick14 / insertpost.php
Created October 10, 2019 08:28
Create a new post with custom post id and custom post name
$post = array(
'import_id' => 9999,
'comment_status' => 'open',
'post_content' => 'hi world!',
'post_name' => 'title_1',
'post_status' => 'publish',
'post_title' => 'your title',
'post_type' => 'post',
);
@kartick14
kartick14 / bigdump.php
Created April 29, 2019 10:04
import db into phpmyadmin (import large size db into localhost or server)
<?php
error_reporting(E_ALL);
// BigDump ver. 0.36b from 2015-04-30
// Staggered import of an large MySQL Dump (like phpMyAdmin 2.x Dump)
// Even through the webservers with hard runtime limit and those in safe mode
// Works fine with latest Chrome, Internet Explorer and Firefox
// Author: Alexey Ozerov (alexey at ozerov dot de)
@kartick14
kartick14 / force-download.html
Created March 7, 2019 11:33
Javascript force file download
<button class="js-download-link button" onclick="downloadFile('https://wattswork.s3.amazonaws.com/test-media/video/test_Drop-1280x720-16-9-HD.mp4','dwn.mp4'); return false;">Download MP4 File</button>
<button class="js-download-link button" onclick="downloadFile('https://wattswork.s3.amazonaws.com/test-media/PDFs/test-file.pdf','tfile.pdf'); return false;">Download PDF File</button>
<button class="js-download-link button" onclick="downloadFile('https://wattswork.s3.amazonaws.com/test-media/Text/test-file.txt','file.txt'); return false;">Download TXT File</button>
<script type="text/javascript">
function downloadFile(data, fileName, type="text/plain") {
// Create an invisible A element
const a = document.createElement("a");
@kartick14
kartick14 / functions.js
Created February 21, 2019 12:32
Create global function in jquery
window.myModule = window.myModule || {};
myModule.upsellReload = (function() { //global function call from anywhere
console.log('Upsell added!');
location.reload();
});
myModule.upsellReload(); //Call function from anywhere
@kartick14
kartick14 / index.html
Created January 22, 2019 08:29
Sticky Sidebar
<header>
Header
</header>
<main>
<div class="center">
<div class="fullwidth">
Full Width Block
</div>
<div class="row">
Tools:
---------
https://gtmetrix.com
https://tools.pingdom.com
https://developers.google.com/speed/pagespeed/insights
Related Articles:
----------------------
https://www.elegantthemes.com/blog/tips-tricks/how-to-improve-your-google-page-speed-score
@kartick14
kartick14 / index.html
Last active December 18, 2018 11:17
Jquery marque/horizontal test slider
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>jQuery Conveyor Ticker Example</title>
<!-- <link href="https://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css"> -->
<!-- <link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css" rel="stylesheet" type="text/css"> -->
<link href="jquery.jConveyorTicker.min.css" rel="stylesheet">
@kartick14
kartick14 / index.html
Created December 18, 2018 11:05
jquery vertical text slide
<div class="pre_header_text visible-web destop_screen" style="background: #000000 none repeat scroll 0 0; color: #ffffff;">
<div class="rw-words rw-words-1 cd-headline slide">
<span class="cd-words-wrapper" style="width: 174px;">
<b class="is-hidden">FREE U.S. Shipping!</b>
<b class="is-hidden">FREE U.S. Shipping! 11</b>
<b class="is-hidden">FREE U.S. Shipping! 222</b>
<b class="is-hidden">FREE U.S. Shipping! 3333</b>
<b class="is-hidden">FREE U.S. Shipping! 44444</b>
<b class="is-visible">Customize your box options now available!</b>
</span>