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 / django_settings.py
Last active January 22, 2020 07:00
Sample Django Settings.py
import os
_isenvsetas = lambda key, default=False: str(os.environ.get(key, ...)).upper() == str(default).upper()
AUTH_PASSWORD_VALIDATORS = [
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', },
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', },
{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', },
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', },
@jerinisready
jerinisready / smoothWheel.js
Created December 30, 2019 11:42
SmoothWheel Javascript. Reference : https://codepen.io/xtianmiller/pen/oGEWQj
(function($){
var self=this,
container,
running=!1,
currentY=0,
targetY=0,
oldY=0,
maxScrollTop=0,
minScrollTop,
direction,
<!DOCTYPE html>
<html>
<title> Jerinisready | Custom Template | Inspired From W3Schools </title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<style>
body,h1,h2{font-family: "Raleway", sans-serif}body, html {height: 100%}
.bgimg {min-height: 100%;background-image: url("https://www.w3schools.com/w3images/wedding_couple.jpg");background-position: center;background-size:cover;}
@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 = ""