Skip to content

Instantly share code, notes, and snippets.


Syed Arefinul Haque syedarehaq

View GitHub Profile
syedarehaq / mysqldump_to_csv
Created Jun 11, 2021
A slightly modified script to convert mysql dump to csv. Utilizing it for the sql dump of wikipedia interwiki links and pagelinks found here: . It is slightly modified to accommodate some special unicode characters from its original source found here:
View mysqldump_to_csv
#!/usr/bin/env python
## Source:
import fileinput
import csv
import sys
# This prevents prematurely closed pipes from raising
# an exception in Python
from signal import signal, SIGPIPE, SIG_DFL
syedarehaq /
Created Oct 22, 2020 — forked from zobayer1/
Simple generator function to download Elasticsearch index data using scroll query
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
class ElasticScroll(object):
"""Manages scroll contexts for elasticsearch scroll queries.
host (str): Elasticsearch host url. Example: ``http://localhost:9200``.
index (str): Elasticsearch index name. Example: ``my_index``.
syedarehaq /
Created Oct 2, 2020
proving Github identity for keybase

Keybase proof

I hereby claim:

  • I am syedarehaq on github.
  • I am syedarehaq ( on keybase.
  • I have a public key ASDBn1wJZyLT4H2_N7hJ_flZa2Eprc6sEYbt1Lyb84Sk7Qo

To claim this, I am signing this object:

syedarehaq /
Created Apr 14, 2020 — forked from jrladd/
Marvel Network: A Tricked-Out D3 Implementation

This force-directed graph takes advantage of the new features of D3 version 4 to display and manipulate a network of Marvel Comics characters. Click "open" to use the full suite of tools.


  • Scroll to zoom.
  • Use the slider to change the edge-weight threshold.
  • Click on nodes to see ego networks (click again to see all nodes).
  • Use the dropdown to show three different centrality measures, calculated using NetworkX in Python and imported through the marvel.json file.
syedarehaq /
Created Feb 20, 2020
Seeking a file at a specific byte position or location, usually useful to debug a BiguQuery export error
import argparse
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(description="go to the line of a specific position")
parser.add_argument("input_fname", help = "The input csv file that we will be reading")
parser.add_argument("pos", help="position where we will be seeking the line", type=float)
args = parser.parse_args()
fname = args.input_fname
position = args.pos
with open(fname) as file: # don't you go correcting me on naming it file. we don't call file directly anyway!