Skip to content

Instantly share code, notes, and snippets.

💯 :atom:

Srividya Bharadwaj srividyacb

💯 :atom:
View GitHub Profile
srividyacb / example-query.js
Created May 26, 2020 — forked from thetrevorharmon/example-query.js
Query JSON with S3 Select in Node.js
View example-query.js
// See for a full explanation of this code
const AWS = require('aws-sdk');
const S3 = new AWS.S3();
exports.handler = async (_, context) => {
try {
const query = 'SELECT * FROM s3object[*].results[*] r;';
// test query is against data from
srividyacb / frechet.js
Created Nov 28, 2019 — forked from argelius/frechet.js
Discrete Frechet Distance
View frechet.js
/* Discrete Fréchet Distance
* By Andreas Argelius
* Implementation of Discrete Frechet Distance in Javascript.
* The paths are defined as [[x0, y0], [x1, y1], ...]
(function() {
srividyacb /
Created Nov 1, 2019 — forked from benbalter/
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
srividyacb /
Created Nov 1, 2019 — forked from mojodna/
GDAL 2.0 on Amazon Linux
sudo yum -y update
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
cd /tmp
curl -L | tar zxf -
cd gdal-2.0.0/
./configure --prefix=/usr/local --without-python
make -j4
sudo make install
View extract-geojson-relations.js
var osmium = require('osmium');
var _ = require("lodash")
var count = 0;
var restrictions=0;
var relHandler = new osmium.Handler();
var geomHandler = new osmium.Handler();
var nodes = []
srividyacb / .bashrc
Created Aug 20, 2019 — forked from JanTvrdik/.bashrc
ssh-agent support for Git Bash / MinGW / msys / Windows
View .bashrc
# put this in ~/.bashrc
export SSH_AUTH_SOCK=/tmp/.ssh-socket
ssh-add -l > /dev/null
if [ $? = 2 ]; then
echo Starting new ssh-agent...
eval $(ssh-agent -a $SSH_AUTH_SOCK) > /dev/null
ssh-add && echo "ssh-agent set up successfully with the following keys:" && ssh-add -l
View gist:6436a5134eda6eb2cce9aaadd52c8129

Fixing India on mapbox-streets style

  • Add Indian disputed boundaries source: planemad.bb1ba8b5 to you style project from the layers panel
  • If the source is locked, open the project.yml file and append it manually to the source field. You would also need to manually add the layers boundaries-claimed and boundaries-disputed after the admin layer similiar to this:
source: "mapbox:///mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6,planemad.bb1ba8b5"
  - landcover
srividyacb / uninstall node and
Created Dec 1, 2015 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
View uninstall node and


lsbom -f -l -s -pf /var/db/receipts/ | while read f; do sudo rm /usr/local/${f}; done sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*

To recap, the best way (I've found) to completely uninstall node + npm is to do the following:

#go to /usr/local/lib and delete any node and node_modules cd /usr/local/lib sudo rm -rf node*