Skip to content

Instantly share code, notes, and snippets.

View pravj's full-sized avatar
📖

Pravendra Singh pravj

📖
View GitHub Profile
@pravj
pravj / sample.java
Last active November 8, 2015 18:52
sample java
// price and discount attributes
int actualPrice;
int discountedPrice;
float discountPercentage;
// product identifiers
int productID;
URL productImage;
String productTitle;
@pravj
pravj / README.md
Last active February 10, 2017 14:55
The GitHub around you

Development

  • 1% rule

  • Community detection

  • Topic modeling the community

  • Influence caused by you and on you

  • Journey of a trending repo

  • Lifetime of a repo

  • Friendship Paradox

  • Degree of separation

#!/usr/bin/env python
from flask import Flask, request
import logging
LOG_FILE = './log/mailer.log'
logging.basicConfig(filename=LOG_FILE, level=logging.INFO)
app = Flask(__name__)
@app.route('/mailman', methods=['POST'])
This file has been truncated, but you can view the full file.
var statesData = {
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "ID_0": 105, "ISO": "IND", "NAME_0": "India", "ID_1": 1, "NAME_1": "Andaman and Nicobar", "NL_NAME_1": "", "VARNAME_1": "Andaman & Nicobar Islands|Andaman et Nicobar|Iihas de Andama e Nicobar|Inseln Andamanen und Nikobare", "TYPE_1": "Union Territor", "ENGTYPE_1": "Union Territory", "filename": "", "filename_1": "", "filename_2": "", "filename_3": "", "filename_4": "" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 93.787727, 6.852640 ], [ 93.788490, 6.852571 ], [ 93.789047, 6.852571 ], [ 93.789047, 6.852291 ], [ 93.789673, 6.852291 ], [ 93.789879, 6.852013 ], [ 93.790154, 6.851945 ], [ 93.790642, 6.851667 ], [ 93.790779, 6.851389 ], [ 93.790916, 6.851042 ], [ 93.790504, 6.850625 ], [ 93.790291, 6.850347 ], [ 93.790001, 6.850279 ], [ 93.789482, 6.849903 ], [ 93.789001, 6.849485 ], [ 93.788376, 6.849137 ], [ 93.788017, 6.848720 ], [ 93.787781, 6.848056 ], [ 93.787506, 6.848061 ], [ 93.787216, 6.84
This file has been truncated, but you can view the full file.
var statesData = {"type": "FeatureCollection", "features": [{"geometry": {"type": "MultiPolygon", "coordinates": [[[[93.787727, 6.85264], [93.78849, 6.852571], [93.789047, 6.852571], [93.789047, 6.852291], [93.789673, 6.852291], [93.789879, 6.852013], [93.790154, 6.851945], [93.790642, 6.851667], [93.790779, 6.851389], [93.790916, 6.851042], [93.790504, 6.850625], [93.790291, 6.850347], [93.790001, 6.850279], [93.789482, 6.849903], [93.789001, 6.849485], [93.788376, 6.849137], [93.788017, 6.84872], [93.787781, 6.848056], [93.787506, 6.848061], [93.787216, 6.847781], [93.786392, 6.847781], [93.78611, 6.848061], [93.785278, 6.848061], [93.784439, 6.8489], [93.784447, 6.849166], [93.785492, 6.84993], [93.786255, 6.850625], [93.786766, 6.851172], [93.786942, 6.851671], [93.787376, 6.851667], [93.787376, 6.852084], [93.787308, 6.852359], [93.787376, 6.852571], [93.787727, 6.85264]]], [[[93.719582, 7.207501], [93.719582, 7.20687], [93.719307, 7.20646], [93.718819, 7.206391], [93.718262, 7.20653], [93.717499, 7.2069
@pravj
pravj / Guide.md
Last active December 27, 2015 18:30

Hi there,

For the map 'From where does India shops?'

Stylesheet and Javascript

You need to add these css and js script in the header section of the HTML.

<script src='https://api.mapbox.com/mapbox.js/v2.2.1/mapbox.js'></script>
@pravj
pravj / karate.gml
Last active September 7, 2016 03:12
GML format of "Zachary's Karate Club" social network.[W. W. Zachary, An information flow model for conflict and fission in small groups, Journal of Anthropological Research 33, 452-473 (1977)]
Creator "Mark Newman on Fri Jul 21 12:39:27 2006"
graph
[
node
[
id 1
label "1"
]
node
[
@pravj
pravj / gauge-post.R
Last active June 13, 2017 21:52
Source code for the post "Gauge charts in R and Python" [R version]
library(plotly)
base_plot <- plot_ly(
type = "pie",
values = c(40, 10, 10, 10, 10, 10, 10),
labels = c("-", "0", "20", "40", "60", "80", "100"),
rotation = 108,
direction = "clockwise",
hole = 0.4,
textinfo = "label",
@pravj
pravj / octogrid_basic.py
Last active November 29, 2017 11:26
The basic version of "octogrid", to visualize communities in GitHub following network
import igraph as ig
import plotly.plotly as py
from plotly.graph_objs import *
G = ig.Graph.Read_GML('network.gml')
labels = list(G.vs['label'])
N = len(labels)
E = [e.tuple for e in G.es]
@pravj
pravj / zap_handler_app.go
Last active May 29, 2016 17:16
Sample application to demonstrate the working of "http.Handler" feature in "uber-go/zap".
// Author: Pravendra Singh (pravj)
// Reference: https://github.com/uber-go/zap/pull/71
// It can be viewed as an application which is trying to load its configurations initially.
// So the log level is `Debug` in starting. The application is emitting both `Info` and `Debug` messages.
// Once the config files are distributed perfectly (simulated by time.Sleep).
// It makes a http request using the provided `Handler` and the log level is changed to `Info`.
// After that the `Debug` messages are ignored.
package main