Skip to content

Instantly share code, notes, and snippets.

View jerinisready's full-sized avatar
💭
A catalyst of Change

JK jerinisready

💭
A catalyst of Change
View GitHub Profile
@jerinisready
jerinisready / intl-input.html
Last active November 6, 2019 07:03
A quick Copy-Paste Example Of intlTelInput With Files from CDNJS. https://github.com/jackocnr/intl-tel-input#getting-started
<html>
<body>
<style>
@import "//cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.4/css/intlTelInput.css";
.iti__flag {background-image: url("//cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.4/img/flags.png");}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.iti__flag {background-image: url("//cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.4/img/[email protected]");}
}
</style>
<form>
https://freefrontend.com/html-css-404-page-templates/
https://codepen.io/leenalavanya/pen/OogLRd
@jerinisready
jerinisready / json-ld-gtm.html
Created October 1, 2019 09:18 — forked from chrisgoddard/json-ld-gtm.html
JSON-LD GTM Tag
<script>
(function(){
var data = {
"@context": "http://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{Page URL}}
},
"headline": {{SCHEMA - Article Headline}},
@jerinisready
jerinisready / mdb-nested-menu.html
Last active July 16, 2019 15:14
This is how we made a nested menu within default mdb jquery admin template. available over : https://mdbootstrap.com/snippets/jquery/jerin_john_kachirackal/936124
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title> Home | Administration </title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:400,700|Material+Icons" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">
<link href="/assets/css/material-dashboard.css" rel="stylesheet" />
@jerinisready
jerinisready / mdb-select2.html
Last active July 10, 2019 10:28
This is how to create MDB Select2 With your own css.. I have used Danger theme.. I wish to make it avail for all other colour codes in mdb!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Material Design Select2 Bootstrap</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/js/select2.min.js"></script>
@jerinisready
jerinisready / README.md
Last active June 29, 2019 05:55
How to Create A Friendly Unique id such as an automatically generated Invoice ID.
Friendly ID / Auto Generate Invoice ID on First Save.

This is just modified version of friendly id for make this script compatible with python 3.x

Invoice numbers like "0000004" are a little unprofessional in that they expose how many sales a system has made, and can be used to monitor the rate of sales over a given time. They are also harder for customers to read back to you, especially if they are 10 digits long.

This is simply a perfect hash function to convert an integer (from eg an ID AutoField) to a unique number. The ID is then made shorter and more user-friendly by converting to a string of letters and numbers that wont be confused for one another (in speech or text).

To use it:
import friendly_id
@jerinisready
jerinisready / media_fiels_for_auth_user_only_views.py
Created June 29, 2019 05:30
Use nginx sendfile (X-Accel-Redirect) function to serve files but pass traffic through django. Can be used to serve media files only to logged-in users.
#https://djangosnippets.org/snippets/10664/
# views.py
from django.http import HttpResponse
from django.views.generic import View
class SendfileView(View):
prefix = ""
@jerinisready
jerinisready / affix_price_bar.html
Last active June 26, 2019 08:10
How To Create A Bottom Bar Affix using Jquery and Css
<DOCTYPE html>
<head>
<title> Affix Price Bar </title>
<style>
#price_bar_container{}
#bottom-price-bar{position: fixed; margin-left: 260px; margin-bottom: 0; padding:0; }
#bottom-price-bar .card{ border-radius: 1px; transition: all 0.15s ease-in-out;}
@jerinisready
jerinisready / reload_on_cache_laod.html
Last active June 21, 2019 10:27
Reload page if a browser-cached version is loaded! ie; via back or forward buttons... https://stackoverflow.com/a/43043658/6419332
<script>
/** Credits: https://stackoverflow.com/a/43043658/6419332 */
window.addEventListener( "pageshow", function ( event ) {
var historyTraversal = event.persisted ||( typeof window.performance != "undefined" &&
window.performance.navigation.type === 2 );
if ( historyTraversal ) {window.location.reload();}
});
</script>
@jerinisready
jerinisready / scroll_menu.html
Created June 20, 2019 08:14
How to make li.active list element in side-menu to display screen
<script>
let el = document.querySelector('.scrollbar li.active');
let elementTop = $(el).offset().top;
let elementBottom = elementTop + $(el).outerHeight();
let viewportTop = $(window).scrollTop();
let viewportBottom = viewportTop + $(window).height() - 80;
if(!(elementBottom > viewportTop && elementTop < viewportBottom)){
el.scrollIntoView()