This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function(){ | |
var data = { | |
"@context": "http://schema.org", | |
"@type": "BlogPosting", | |
"mainEntityOfPage": { | |
"@type": "WebPage", | |
"@id": {{Page URL}} | |
}, | |
"headline": {{SCHEMA - Article Headline}}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ancestor Selector | |
function ancestor(selector, ancestor, rule) { | |
let styles = '' | |
let count = 0 | |
Array.from(document.querySelectorAll(ancestor)) | |
.filter(tag => tag.querySelector(selector)) | |
.forEach(tag => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
CHECKS = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |