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
import tensorflow as tf
import os
import numpy as np
import matplotlib.pyplot as plt
base_dir = "/Users/dhananjay.trivedi/Downloads/Train/"
"""
# Use `ImageDataGenerator` to rescale the images.
@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 / nginx.conf
Created March 6, 2019 11:32 — forked from leandromoreira/nginx.conf
nginx.conf optmized for http/2 = HTTPS TLS (ssl)
# command to generate dhparams.pen
# openssl dhparam -out /etc/nginx/conf.d/dhparams.pem 2048
limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;
limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=5r/s;
limit_req_status 444;
limit_conn_status 503;
proxy_cache_path /var/lib/nginx/proxy levels=1:2 keys_zone=backcache:8m max_size=50m;
proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args";
@jerinisready
jerinisready / ancestor-selector.js
Created November 29, 2018 12:17 — forked from tomhodgins/ancestor-selector.js
Download ZIP to view and edit, or preview index.html online at: http://staticresource.com/helpers
// Ancestor Selector
function ancestor(selector, ancestor, rule) {
let styles = ''
let count = 0
Array.from(document.querySelectorAll(ancestor))
.filter(tag => tag.querySelector(selector))
.forEach(tag => {
@jerinisready
jerinisready / through_relationships.py
Created November 14, 2018 04:44 — forked from jhgaylor/through_relationships.py
Example of using a through model in Django and filtering by a value on the custom through model.
class A(models.Model):
things = models.ManyToManyField("B", through=ThroughModel)
class B(models.Model):
text = models.TextField()
class ThroughModel(models.Model):
a = models.ForeignKey(A)
b = models.ForeignKey(B)
extra = models.BooleanField()
@jerinisready
jerinisready / gist:1bcc5ca615765d76058860293c3144ec
Created May 13, 2018 10:54 — forked from thraxil/gist:3123935
django project git pre-commit hook
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [
@jerinisready
jerinisready / indexes.sql
Last active April 4, 2018 05:28 — forked from garethrees/indexes.sql
List all indexes in postgres database
# VIEW INDEXES applied on database.
select schemaname, tablename, indexname, indexdef from pg_indexes WHERE schemaname='public';
# Create superuser for postgres on linux shell with postgres user.
user@ubuntu$ sudo su postgres
user@ubuntu$ createuser --interactive --pwprompt root
> Enter password for new role: ********
> Enter it again: ********
> Shall the new role be a superuser? (y/n) y