Skip to content

Instantly share code, notes, and snippets.

View pushpendrapratap's full-sized avatar
🎧

pushpendra pratap pushpendrapratap

🎧
View GitHub Profile
@pushpendrapratap
pushpendrapratap / web_scrapping.py
Last active October 7, 2017 03:42
Web Scrapping using python bs4
class TravelAgentsScrap(object):
prefix = "https://www.consumercomplaints.in"
start_url = "https://www.consumercomplaints.in/bysubcategory/travel-agents"
filename = "index_travel_agents.csv"
@classmethod
def _save_to_file(cls, sentence_list, filename=None):
if filename is None:
filename = cls.filename
with open(filename, "a") as csv_file:
@pushpendrapratap
pushpendrapratap / min-char-rnn.py
Created October 9, 2017 06:03 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@pushpendrapratap
pushpendrapratap / labels_1024.tsv
Created November 13, 2017 19:36 — forked from teamdandelion/labels_1024.tsv
TensorBoard: TF Dev Summit Tutorial
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
7
2
1
0
4
1
4
9
5
9
@pushpendrapratap
pushpendrapratap / System Design.md
Created January 5, 2018 16:18 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@pushpendrapratap
pushpendrapratap / osx_setup.md
Created October 9, 2018 10:17 — forked from millermedeiros/osx_setup.md
Mac OS X setup

Setup Mac OS X

Edit: I've done the same process every couple years since 2013 (Mountain Lion, Mavericks and High Sierra).

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the process, but TBH I have this laptop for almost 3yrs and this is the first

@pushpendrapratap
pushpendrapratap / tabular-rf.ipynb
Created October 13, 2018 03:15 — forked from dienhoa/tabular-rf.ipynb
data preprocessing with Tabular Module fast.ai
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from bs4 import BeautifulSoup
# copied from https://github.com/bookmarks-tools/bookmarks-parser/blob/master/bookmarks_parser/bookmarks_parser.py
def get_node_data(node):
data = {}
for child in node:
if child.name == 'a':
data['type'] = 'bookmark'
repo_name,commit_count,comment_count,pr_count,all_langs
Loopster-Loopster-Web,2418,0,0,"['PHP', 'JavaScript', 'CSS', 'HTML', 'Shell', 'Batchfile', 'ApacheConf', 'Ruby']"
Lockton-LocktonInsurance-iOS,461,0,0,"['Objective-C', 'C', 'HTML', 'Makefile', 'CSS', 'Ruby', 'C++', 'Roff', 'Python']"
Hello-Hello,143,0,0,"['Objective-C', 'Java', 'C', 'JavaScript', 'C++', 'Objective-C++', 'Perl', 'Shell']"
ConcertPass-ConcertPass-API,729,0,0,"['HTML', 'PHP', 'JavaScript', 'CSS', 'Shell', 'ApacheConf']"
ConcertPass-ConcertPass-CMS,445,0,0,"['PHP', 'JavaScript', 'CSS', 'HTML', 'PLSQL', 'SQLPL', 'Shell', 'PLpgSQL']"
Waspit-Waspit-Android,3654,1,1,['Java']
Springer-Myriad-Web,3,0,0,"['PHP', 'JavaScript', 'Python', 'CSS', 'Perl', 'Shell']"
KiwiTech-TopKit-Backend,12,0,0,"['Python', 'JavaScript', 'HTML', 'CSS']"
GlobeChat-GlobeChat-Backend,5,0,0,"['Ruby', 'HTML', 'CSS', 'JavaScript']"
@pushpendrapratap
pushpendrapratap / grab_foods_scraper.py
Last active August 24, 2021 07:42
Given a base_url ("https://food.grab.com/ph/en/restaurants"), capture all restaurants (based on user's submitted location, e.g., Manila) latitude & longitude by intercepting grab-foods internal POST request
"""
requirements.txt
selenium==3.141.0
selenium-wire==4.4.1
"""
import json
from time import sleep