Skip to content

Instantly share code, notes, and snippets.

View anandology's full-sized avatar

Anand Chitipothu anandology

View GitHub Profile
@anandology
anandology / parse_voter_rolls.py
Last active May 31, 2019 05:03
Script to extract voter info from voter rolls
"""Script to extract voter info from voter rolls.
This script expects the extracted text file from the voter-list pdf.
It can be done using:
$ pdftotext -layout AC1580002.pdf
"""
import sys
@anandology
anandology / pg-encoding.txt
Created July 8, 2013 15:23
Fixing PostgreSQL default encoding in Ubuntu
# Option 1 - rebuild the cluster
# This will delete alle existing data
pg_dropcluster --stop 9.2 main
pg_createcluster --start -e UTF-8 9.2 main
# Option 2 - rebuild the template1 database
# All the database created after this will have UTF-8 encoding
@anandology
anandology / python-engineer.md
Last active August 31, 2018 06:11
We are looking for an experienced python engineer to join our team at Rorodata.

We are looking for an experienced python engineer to join our team at Rorodata, a data analytics startup based in Hyderabad. Interesting work in the intersection of data science, infrastructure and microservices.

This is a full-time position based out of Hyderabad. We can explore remote working only in exceptional cases.

Please ping us on rorodata.team@gmail.com if this sounds interesting to you.

About Rorodata

@anandology
anandology / rdash.py
Created June 22, 2017 06:21
POC implementation of reactive expressions for Dash
"""Reactive expressions for Dash!
Dash[1] is an interesting project build reactive web applications in Python.
While the ideas are exciting, the syntax for specifying custom code is way
too complicated that it should be.
Here is a sample code to display sum of two input values.
@app.callback(
[Input(component_id='x', component_property='value')]

Hello

Level 2

Test

@anandology
anandology / custom.css
Last active December 18, 2017 11:45
Custom CSS to optimize jupyter notebook presentation in full-screen when zoomed in
/*
FILE: ~/.jupyter/custom/custom.css
Custom CSS to optimize jupyter notebook presentation in full-screen when zoomed in.
*/
@media all and (max-width: 800px) {
/* Hide prompt when zoomed in */
.prompt {
display: none !important;
}
@anandology
anandology / fabfile.py
Created September 19, 2017 16:19
Fabric demo
"""Fabric demo.
Setup Instructions:
pip install Fabric3
How to use:
fab --list
fab hello
@anandology
anandology / Makefile
Created November 13, 2015 05:42
Makefile to export jupyterhub notebooks for all users to html
#
# Makefile to export ipython notebooks in each user home to html
# The output goes to build/$USER/$FILENAME.html
#
SOURCES=$(wildcard /home/*/*.ipynb)
TARGETS=$(shell echo $(SOURCES) | sed -e 's/.ipynb/.html/g' -e 's,/home/,build/,g')
default: $(TARGETS)
debug:
@anandology
anandology / top-features.py
Created March 15, 2017 05:04
Script to find most common features found from multiple runs of an algorithm with different parameters.
"""Script to find most common features found from
multiple runs of an algorithm with different parameters.
"""
from collections import Counter
runs = [
["a", "b", "c", "d", "e"],
["a", "b", "c", "d", "f"],
["a", "b", "c", "e", "g"],
["a", "b", "d", "f", "h"]
@anandology
anandology / boxoffice.html
Created September 2, 2016 05:25
Box Office widget snippet
<div id="boxoffice-widget" style="padding-top: 0px;"><script src="https://checkout.razorpay.com/v1/checkout.js"></script> <div class="payment-progress-wrapper payment-stages-bg" id="payment-stages"><ul class="progress-indicator"><li class="indicator active "><span class="bubble"></span>Select Tickets<br></li><li class="indicator "><span class="bubble"></span>Payment<br></li><li class="indicator "><span class="bubble"></span>Confirm<br></li></ul></div> <div class="payment-stages-wrapper"><div id="boxoffice-selectItems" class="boxoffice-section ticket-selection-content clearfix"><div id="workshop"><div><h1 class="category-heading">Workshop</h1></div> <div><div class="ticket-booking clearfix " id="python-generators-inside-out"><div class="ticket-details"><p class="ticket-title">Python Generators Inside Out</p> <div class="ticket-description"><p><i class="fa fa-calendar"></i>18 September 2016</p><p><i class="fa fa-map-marker ticket-venue"></i>TERI, Domlur, Bangalore</p><p><i class="fa fa-info" aria-hidden="tru