Skip to content

Instantly share code, notes, and snippets.

View bhavika's full-sized avatar

Bhavika Tekwani bhavika

View GitHub Profile
@bhavika
bhavika / netflix_in.py
Last active January 8, 2016 14:21
Comparing the US & India Netflix collections | Excel file: https://goo.gl/JZMb3C
from urllib.request import urlopen
from bs4 import BeautifulSoup as bs
import csv as csv
url = 'http://www.finder.com/in/netflix-india-vs-netflix-us-titles-list'
html = urlopen(url).read()
soup = bs(html, "lxml")
table = soup.find('table', id='tablepress-9')
@bhavika
bhavika / renameutil.bat
Last active January 8, 2016 14:22
Batch file to copy a folder to a destination and change its name to the current date
set source= source path
set destination= dest path
for /f "tokens=2 delims==" %%G in ('wmic os get localdatetime /value') do set datetime=%%G
set year=%datetime:~0,4%
set month=%datetime:~4,2%
set day=%datetime:~6,2%
set folder = "Books"
xcopy /s /i %source% %destination%_%year%-%month%-%day% /E /y
pause
http://dask.pydata.org/en/latest/use-cases.html
Progress bars: http://distributed.readthedocs.io/en/latest/web.html
#!/usr/bin/env bash
#Code adapted from https://gist.github.com/yangj1e/3641843c758201ebbc6c (Modified to Python3.5)
cd ~
#wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.4.0-Linux-x86_64.sh
wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.4.1-Linux-x86_64.sh
bash Anaconda3-2.4.1-Linux-x86_64.sh -b
echo 'PATH="/home/ubuntu/anaconda3/bin:$PATH"' >> .bashrc
. .bashrc

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

Keybase proof

I hereby claim:

  • I am bhavika on github.
  • I am bhavika (https://keybase.io/bhavika) on keybase.
  • I have a public key whose fingerprint is 9560 2C5B 4FBF F6B7 20FE CA07 8DE0 2A9A 10C5 B55F

To claim this, I am signing this object:

@bhavika
bhavika / docker_help.txt
Last active August 2, 2017 04:59
Docker commands I use frequently
Delete all containers:
docker rm $(docker ps -a -q)
Delete all images:
docker rmi $(docker images -q)
@bhavika
bhavika / PyDataDC2016_SharedResources
Last active April 19, 2018 15:31
Code and material used in PyData DC 2016 talks
1. Using Dask for Parallel Computing in Python (http://pydata.org/dc2016/schedule/presentation/59/)
Github: https://github.com/jseabold/dask-pydata-dc-2016
2. Building Your First Data Pipelines (http://pydata.org/dc2016/schedule/presentation/10/)
Github: https://github.com/hunterowens/data-pipelines
3. Doing frequentist statistics in Python (http://pydata.org/dc2016/schedule/presentation/9/)
Github: https://github.com/gapatino/Doing-frequentist-statistics-with-Scipy
4. Machine Learning with Text in scikit-learn (http://pydata.org/dc2016/schedule/presentation/12/)
@bhavika
bhavika / sudoku.py
Created November 10, 2018 07:13
Sudoku Solver
# Sudoku Solver - Peter A. Norvig
digits = '123456789'
rows = 'ABCDEFGHI'
cols = digits
def cross(A, B):
return [a+b for a in A for b in B]
squares = cross(rows, cols)