Skip to content

Instantly share code, notes, and snippets.

View pavan538's full-sized avatar

Pavan Kumar pavan538

View GitHub Profile
@pavan538
pavan538 / solrMysqlSetup.md
Created July 31, 2019 08:45 — forked from rnjailamba/solrMysqlSetup.md
Solr + Mysql + Data Import Handler + Delta Import Handler [ Version 5.5.0 of solr ]
@pavan538
pavan538 / 00. tutorial.md
Created July 31, 2019 08:45 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@pavan538
pavan538 / http_streaming.md
Created June 25, 2019 12:02 — forked from CMCDragonkai/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@pavan538
pavan538 / fpcursorpagination.py
Created June 6, 2019 06:42 — forked from keturn/fpcursorpagination.py
test for CursorPagination with floating point field
class FloatingPointCursorPagination(CursorPagination):
__rounding_down = decimal.Context(prec=14, rounding=decimal.ROUND_FLOOR)
__rounding_up = decimal.Context(prec=14, rounding=decimal.ROUND_CEILING)
def _get_position_from_instance(self, instance, ordering):
field_name = ordering[0].lstrip('-')
if isinstance(instance, dict):
attr = instance[field_name]
else:
attr = getattr(instance, field_name)
@pavan538
pavan538 / .gitignore
Created May 27, 2019 11:10 — forked from akaihola/.gitignore
streaming-json-encoder
*.pyc
/bin
/include
/lib
@pavan538
pavan538 / TestUnionEvolution.java
Created April 9, 2019 16:46 — forked from ept/TestUnionEvolution.java
Adding a new branch to an Avro union
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericDatumReader;
import org.apache.avro.generic.GenericDatumWriter;
import org.apache.avro.generic.GenericRecordBuilder;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DatumReader;
@pavan538
pavan538 / cbv_multiple_forms.html
Created April 4, 2019 17:55 — forked from badri/cbv_multiple_forms.html
Django multiple forms code with sample usage
{% extends "base.html" %}
{% block content %}
<form method="post">{% csrf_token %}
{{ forms.subscription }}
<input type="submit" value="Subscribe">
</form>
<form method="post">{% csrf_token %}
{{ forms.contact }}
<input type="submit" value="Send">
@pavan538
pavan538 / python_json_encoders.py
Last active April 3, 2019 10:19 — forked from simonw/gist:7000493
How to use custom Python JSON serializers and deserializers to automatically roundtrip complex types.
import json, datetime
class RoundTripEncoder(json.JSONEncoder):
DATE_FORMAT = "%Y-%m-%d"
TIME_FORMAT = "%H:%M:%S"
def default(self, obj):
if isinstance(obj, datetime.datetime):
return {
"_type": "datetime",
"value": obj.strftime("%s %s" % (
@pavan538
pavan538 / css-media-queries-cheat-sheet.css
Created February 19, 2019 06:30 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@pavan538
pavan538 / ubuntu-bionic-openldap-mysql.sh
Created February 4, 2019 12:20 — forked from mahirrudin/ubuntu-bionic-openldap-mysql.sh
OpenLDAP with MySQL Backend - Ubuntu 18.04
## installation openldap with backend mysql
sudo apt update && sudo apt upgrade -y && sudo reboot
sudo apt install mysql-server unixodbc make gcc libmysqlclient-dev unixodbc-dev groff ldap-utils
## mysql login as root
sudo mysql -u root
CREATE DATABASE ldap
CREATE USER 'ldap'@'%' IDENTIFIED BY 'S3cureP4ssw0rd$';
GRANT ALL PRIVILEGES ON ldap.* TO 'ldap'@'%';