Skip to content

Instantly share code, notes, and snippets.

View answerquest's full-sized avatar

Nikhil VJ answerquest

View GitHub Profile
@answerquest
answerquest / matomo-python-1.py
Last active April 29, 2019 05:24
python function for usage tracking using self-hosted Matomo
import json, requests, platform
'''
29.April.2019 by Nikhil VJ
this Python 3 function sends a non-invasive simple usage ping to your self-hosted Matomo analytics site
No more allowing Google to track your users while they let you have some crumbs in exchange.
Reference: https://developer.matomo.org/api-reference/tracking-api
This function adds in metrics of the operating system (which was my use case).
you can skip all that stuff if you wish.
@answerquest
answerquest / 19.2.19 Delhi GTFS-RT vehicle update feed analysis.ipynb
Last active February 20, 2019 12:42
19.2.19 Delhi GTFS-RT vehicle update feed analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 24 columns, instead of 2 in line 9.
Region,RTO,Motor Cycles,Scooters,Moped,Cars,Jeeps,Stn. Wagons,Taxis meter fited,Luxury /Turist Cabs/,Auto-rikshaws,Stage carriages,Contract carriages /Mini Bus,School Buses,Private Service Vehicles,Ambulances,Articulated/Multi.,Trucks & Lorries,Tanker,Delivery Van (4 wheelers),Delivery Van (3 wheelers),Tractors,Trailors,Others
Greater Mumbai,Mumbai (C),5154,5969,89,8760,251,0,3244,0,0,170,93,0,6,17,0,62,20,184,195,2,4,65
Greater Mumbai,Mumbai (W),10738,5552,90,8227,100,0,723,0,4460,0,94,0,7,14,0,56,4,269,665,33,3,0
Greater Mumbai,Mumbai (E),6525,1813,427,2245,257,57,24,0,2633,0,64,2,26,11,0,19,0,58,412,0,0,20
Greater Mumbai,Borivali,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Thane Region,Thane,20117,6299,489,20165,2469,0,536,0,2692,36,119,0,52,7,0,1957,157,1748,534,41,180,49
Thane Region,Kalyan,7271,2694,403,1034,230,0,94,0,1743,41,14,0,4,12,0,126,3,128,325,12,11,4
Thane Region,Vashi,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Thane Region,Vasai,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Panvel Region,Panve
@answerquest
answerquest / sanitation-choropleth-folium.ipynb
Last active February 3, 2019 11:43
3.2.19 - Sanitation data shown on choropleth using folium in python 3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@answerquest
answerquest / 3.2.19 break by route_id, vehicle_id.ipynb
Last active February 3, 2019 03:22
3.2.19 break large pmpml gps logs dataset (2019-01-19 16:00 to 2019-01-27 18:00 IST) by route_id, vehicle_id
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@answerquest
answerquest / recursiveDropdown.py
Last active December 3, 2018 14:24
recursiveDropdown : Python3 function: recursively scans 'targetFolder' for all files ending with extension 'ext' (or all files by default), and generates innerHTML for a dropdown menu, with respective sub-folder paths as optgroups.
def recursiveDropdown(targetFolder = '.', ext=''):
'''
Author : Nikhil VJ, http://nikhilvj.co.in
Date: 03 December 2018
recursiveDropdown(targetFolder = '.', ext='')
recursively scans targetFolder for all files ending with extension ext (or all files by default), and generates innerHTML for a dropdown menu, with respective sub-folder paths as optgroups.
'''
if targetFolder.endswith('/'): targetFolder = targetFolder[:-1]
content = '<option value="">Select one</option>'
@answerquest
answerquest / Latur-taluka.geojson
Last active October 26, 2018 08:59
Making choropleth maps without QGIS or coding
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@answerquest
answerquest / ITR-4 professions list AY2018-19.csv
Last active April 12, 2019 09:20
Professions/businesses list as seen in dropdown in ITR-4, India Income Tax filing, AY 2018-19, FY 2017-18 on https://incometaxindiaefiling.gov.in on 10 July 2018
code profession under ITR-4, India Income Tax filing, AY 2018-19, FY 2017-18
1001 01001-Growing and manufacturing of tea
1002 01002-Growing and manufacturing of coffee
1003 01003-Growing and manufacturing of rubber
1004 01004-Market gardening and horticulture specialties
1005 01005-Raising of silk worms and production of silk
1006 01006-Raising of bees and production of honey
1007 01007-Raising of poultry and production of eggs
1008 01008-Rearing of sheep and production of wool
1009 01009-Rearing of animals and production of animal products
@answerquest
answerquest / ArticlesListing.csv
Last active May 27, 2018 14:17
transactional scrape.ipynb
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
"article-type","authors","citations link","cross-ref citations","issue","link","online pub date","pages","pdf link","references link","subject","title","views","volume"
"","[{'role': '(President)', 'degree': 'M.D.', 'name': 'Kenneth V. Everts', 'authorURL': 'https://tandfonline.com/author/Everts%2C+Kenneth+V'}]","https://tandfonline.com/doi/abs/10.1177/036215377100100101","0",1,"https://tandfonline.com/doi/abs/10.1177/036215377100100101","02 Jan 2018","4","https://tandfonline.com/doi/pdf/10.1177/036215377100100101","","The President's Page ","The President's Page","2",1
"","[{'name': 'Warren D. Cheney', 'authorURL': 'https://tandfonline.com/author/Cheney%2C+Warren+D'}]","https://tandfonline.com/doi/abs/10.1177/036215377100100102","1",1,"https://tandfonline.com/doi/abs/10.1177/036215377100100102","02 Jan 2018","5","https://tandfonline.com/doi/pdf/10.1177/036215377100100102","","Introducing the Transactional Analysis Journal ","Introducing the Transactional Analysis Journal","4",1
"Article","[{'degree': 'M.D.',
@answerquest
answerquest / python2 successfull installation log.md
Created May 15, 2018 04:53
ViXeN installation on Lubuntu 16.04 32bit OS

Tried again with python2

(deleted existing vixen folder, git clone and cd into vixen folder)

$ virtualenv -p python2 /tmp/VIRTUAL2
Running virtualenv with interpreter /usr/bin/python2
New python executable in /tmp/VIRTUAL2/bin/python2
Also creating executable in /tmp/VIRTUAL2/bin/python
Installing setuptools, pip, wheel...done.