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 / functions.php
Created October 11, 2018 12:22
woocommerce checkout page call action when place order is trigger
add_action('woocommerce_after_checkout_validation', 'rei_after_checkout_validation');
function rei_after_checkout_validation( $posted ) {
// do all your logics here...
// adding wc_add_notice with a second parameter of "error" will stop the form...
// wc_add_notice( __( "OMG! You're not human!", 'woocommerce' ), 'error' );
if (empty($_POST['captcha'])) {
wc_add_notice( __( "Captcha is empty!", 'woocommerce' ), 'error' );
@kartick14
kartick14 / index.html
Created November 6, 2018 10:38
CHECK IF USERS STOP SCROLLING
<style>
body {
margin: 0;
padding: 0;
line-height: 1.5;
}
#output {
width: 100%;
height: 2em;
background: #eee;
@kartick14
kartick14 / utf-bom.php
Created November 10, 2018 19:59
utf remove BOM character form web page
<?php
// Tell me the root folder path.
// You can also try this one
// $HOME = $_SERVER["DOCUMENT_ROOT"];
// Or this
// dirname(__FILE__)
$HOME = dirname(__FILE__);
// Is this a Windows host ? If it is, change this line to $WIN = 1;
$WIN = 0;
@kartick14
kartick14 / index.html
Created December 5, 2018 06:53
canvas drawing-erase-tools change with save as image to db
//https://jsfiddle.net/richardcwc/d2gxjdva/
<canvas id="canvas" width="500" height="500"></canvas>
<ul class="demoToolList">
<li>Brush color: <button class="brushcolor" type="button" value="black">Black</button><button class="brushcolor" type="button" value="white">White</button><button class="brushcolor" type="button" value="silver">Silver</button>
</li>
<li>Brush size: <button class="brushsize" type="button" value="small">Small</button><button class="brushsize" type="button" value="normal">Normal</button><button class="brushsize" type="button" value="large">Large</button></li>
<li><span style="display: block; margin-bottom: 20px;" class="line-opacity-controls">
<label for="line-opacity-control">Line opacity:</label>
<span class="info" id="rangeinfo" style="width: 15px; display: inline-block; text-align: center">50%</span>
@kartick14
kartick14 / README.php.detect_os.md
Created December 12, 2018 09:39
PHP: Detect user's operating system

Usage

It's that simple:

$os = getOS($_SERVER['HTTP_USER_AGENT']);

echo $os;
@kartick14
kartick14 / index.html
Created December 16, 2018 13:54
jquery open link in second click
<!DOCTYPE html>
<html>
<head>
<title>Test jquery</title>
</head>
<body>
<ul class="parentul">
<li class=""><a href="http://www.iamtallmirror.com/">First</a></li>
<li class=""><a href="">Second</a></li>
<li class=""><a href="">Third</a></li>
@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>
@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">
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
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">