Skip to content

Instantly share code, notes, and snippets.

@vik-y
vik-y / live-score.py
Created March 20, 2016 16:34
Script to get Live score from cricbuzz website.
import time
import re
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
def cleanhtml(raw_html):
cleanr =re.compile('<.*?>')
cleantext = re.sub(cleanr,'', raw_html)
return cleantext
def liveScore():
@vik-y
vik-y / Readme.txt
Created March 18, 2016 20:44
Eclipse ProR installation
How to Install ProR plugin into Eclipse
Open Eclipse
Go to Help->Install New Software
Click on Add new site
Add name as : ProR
link:
http://download.eclipse.org/rmf/updates/releases
@vik-y
vik-y / Readme.txt
Created January 31, 2016 19:27
Getting started with python networkx
These are some resources collected/generated by me while beginning with networkx
Install using:
sudo pip install networkx
Examples given here
https://networkx.github.io/examples.html
>>> import networkx as nx
>>> G=nx.Graph()
>>> G.add_node("spam")
@vik-y
vik-y / link_account.py
Created January 31, 2016 13:55
A simple python script to upload files to dropbox
@vik-y
vik-y / jsonpy.py
Created December 12, 2015 09:23
Generate and read json using python
# Generating json
import json
from pprint import pprint
data = {}
data['key'] = ['value']
data['1']='bak'
json_data = json.dumps(data)
# Output: '{"1": "bak", "key": ["value"]}'
@vik-y
vik-y / backup.sh
Created December 11, 2015 03:58
A script to backup all mysql databases
#!/bin/sh
# System + MySQL backup script
# Copyright (c) 2008 Marchost
# This script is licensed under GNU GPL version 2.0 or above
# ---------------------------------------------------------------------
# Taken from : https://www.howtoforge.com/shell-script-to-back-up-all-mysql-databases-each-table-in-an-individual-file-and-upload-to-remote-ftp
#########################
######TO BE MODIFIED#####
@vik-y
vik-y / update-ruby.sh
Created November 21, 2015 11:05 — forked from scmx/upgrade-install-ruby-2-1-2-ubuntu-12-04.md
Upgrade/Install ruby 2.1.2 #ubuntu #12.04 #14.04
# Reference http://stackoverflow.com/a/18490935/2037928
# Login as root
# Install needed packages
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
# Download appropriate ruby version https://www.ruby-lang.org/en/downloads/
@vik-y
vik-y / readme.txt
Last active May 19, 2017 17:41
Web Development - Things you need to know
Some info and links to help people understand what exactly is web development, what are its key elements and all
you need to know to get started
First of all what is a Server?
http://whatis.techtarget.com/definition/server
What is a Client-Server architecture?
- It is one of the most prominent architectures used to design any software which interacts with web. Be it a website,
a chat service or anything.
https://en.wikipedia.org/wiki/Client%E2%80%93server_model
@vik-y
vik-y / class_related.rb
Last active October 31, 2015 07:22
Some important things about ruby
@vik-y
vik-y / pc-lock.c
Created September 26, 2015 13:09
Producer Consumer Problem Implementation using lock and turn variables
/*
* pc-lock.c
*
* Created on: Sep 24, 2015
* Author: Vikas Yadav (IMT2013060)
* Producer Consumer Problem using lock variables
*
* NOTE:
*
* This solution works most of the time properly.