Skip to content

Instantly share code, notes, and snippets.

View py-ranoid's full-sized avatar

Vishal Gupta py-ranoid

View GitHub Profile
@py-ranoid
py-ranoid / githubinit.py
Last active December 25, 2017 19:16
Create git repository with remote to github
import os,requests,sys
# import argparse
# parser = argparse.ArgumentParser(description='repo name')
# parser.add_argument("-n", "--name", help="Name",default='Meh')
# args = parser.parse_args()
# value = args.name
value = sys.argv[1]
os.system('git init '+value)
@py-ranoid
py-ranoid / ytsong.py
Created January 15, 2018 07:18
Song Downloader (from YouTube)
from bs4 import BeautifulSoup
import youtube_dl
import webbrowser
import urllib2
import os
import sys
'''
import argparse
parser = argparse.ArgumentParser()
@py-ranoid
py-ranoid / stats.csv
Created May 19, 2018 16:40
GSoC'18 Stats
participants stipend
India 605.0 2400
United States 104.0 6000
Germany 53.0 6000
China 52.0 3600
Sri Lanka 41.0 2400
Russian Federation 35.0 3600
Canada 31.0 6600
United Kingdom 28.0 6600
Italy 24.0 6000
@py-ranoid
py-ranoid / download_word2vec.sh
Last active October 16, 2018 06:06
Download GoogleNews word vectors from terminal.
function gdrive_download () {
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
rm -rf /tmp/cookies.txt
}
gdrive_download 0B7XkCwpI5KDYNlNUTTlSS21pQmM GoogleNews-vectors-negative300.bin.gz
Brand Model Android Version Build Remote Input File Transfer (Desk2App) File Transfer (App2Desk) Reconnect (Desktop disruption) Reconnect (Phone disruption)
OnePlus 5T 8.1.0 lastStableBuild comments comments comments comments comments
OnePlus 5T 8.1.0 lastSuccessfulBuild comments comments comments comments comments
from urllib2 import urlopen
from bs4 import BeautifulSoup
import pickle
import time
def getPlan(html):
return sum(float(i.text.split(' ')[0]) for i in html.find_all('div', attrs={'class': 'description'})[0].find_all('span'))
{"class_name": "Sequential", "config": [{"class_name": "LSTM", "config": {"name": "lstm_2", "trainable": true, "batch_input_shape": [null, 3, 27], "dtype": "float32", "return_sequences": false, "return_state": false, "go_backwards": false, "stateful": false, "unroll": false, "units": 16, "activation": "tanh", "recurrent_activation": "hard_sigmoid", "use_bias": true, "kernel_initializer": {"class_name": "VarianceScaling", "config": {"scale": 1.0, "mode": "fan_avg", "distribution": "uniform", "seed": null}}, "recurrent_initializer": {"class_name": "Orthogonal", "config": {"gain": 1.0, "seed": null}}, "bias_initializer": {"class_name": "Zeros", "config": {}}, "unit_forget_bias": true, "kernel_regularizer": null, "recurrent_regularizer": null, "bias_regularizer": null, "activity_regularizer": null, "kernel_constraint": null, "recurrent_constraint": null, "bias_constraint": null, "dropout": 0.0, "recurrent_dropout": 0.0, "implementation": 1}}, {"class_name": "Dense", "config": {"name": "dense_2", "trainable": true
@py-ranoid
py-ranoid / SeleniumScraper.py
Last active December 27, 2018 05:19
Fetching a website's source (HTML) with Selenium over Python.
from selenium import webdriver,common
"""
How to Download Chrome Driver :
- Go to https://chromedriver.storage.googleapis.com/index.html?path=2.45/
- Download and unzip webdriver for your OS
- Move the webdriver to a where it can be accessed by python. (Same directory or $PATH)
"""
try :
@py-ranoid
py-ranoid / SeqModelsSlides.md
Last active December 27, 2018 05:54
Markdown Content for my slides on RNNs and LSTMs. To present as a slideshow refer : http://vishalgupta.me/md-slides/
@py-ranoid
py-ranoid / gci_instance_dump.py
Created January 14, 2019 06:52
Downloading Google CodeIn tasks without an API Key.
all_rows = []
for fname in glob("/Users/vishalgupta/Downloads/Task instances _ Google Code-in *.htm"):
with open(fname) as f:
cont = f.read()
s = soup(cont)
rows = s.select('md-table-container tbody tr')
for row in rows:
vals = [i.text.strip() for i in row.select('td') if i.text.strip()]