Skip to content

Instantly share code, notes, and snippets.

View vikranth22446's full-sized avatar

Vikranth Srivatsa vikranth22446

View GitHub Profile
@vikranth22446
vikranth22446 / solver.py
Created June 17, 2021 01:56
Sample MIP LP solver for shortest path single commodity flow
from mip import *
import networkx as nx
from dataclasses import dataclass
def solve(graph, start_node, end_node):
m = Model(sense=MINIMIZE)
total_flow = len(graph.nodes()) - 1
path_taken = {}
flow_constraints = {}
@vikranth22446
vikranth22446 / gurobi_installation-1.sh
Last active December 5, 2019 23:00
Gurobi installation on server with non academic domain for academic purposes
# Gurobi installation on server with non academic domain for academic purposes
# Used for cs170 project
# Run on Ubuntu 19.10
sudo apt-get update
sudo apt-get install python3 python3-pip virtualenv
wget https://packages.gurobi.com/9.0/gurobi9.0.0_linux64.tar.gz
tar xzvf gurobi9.0.0_linux64.tar.gz
# now run part 2
# get key at https://www.gurobi.com/downloads/end-user-license-agreement-academic/
@vikranth22446
vikranth22446 / js-form-fill.py
Created September 10, 2018 18:05
Selenium script to fill a google form
# Instructions: pip install selenium requests & brew install geckodriver.
import requests
from selenium import webdriver
tinyurl = "INSERT_EXTENSION"
resp = requests.get("http://tinyurl.com/{}".format(tinyurl))
# use chrome via driver = webdriver.Chrome()
driver = webdriver.Firefox()
driver.get(resp.url)
full_name = "INSERT_FULL_NAME"
@vikranth22446
vikranth22446 / CookiecutterFormat.md
Last active July 4, 2018 01:12
Cookiecutter new context features with minimal changes

Cookiecutter new format

Installation

pip install -e git+https://github.com/vikranth22446/cookiecutter@update-config#egg=cookiecutter

Features

The fork branch extends cookiecutter to include:

  • custom prompt
  • description
  • prompt_user
@vikranth22446
vikranth22446 / CalculateBioGradesCSV.js
Last active November 4, 2017 06:17
Downloads an Excel Spreadsheet for badly formatted Bio Scores.
/**
- Run via pasting into inspect element in the console tab on the Bio Progress Report.
- Check the CSV for a SUM Function, and click the function button.
**/
if (document.title.match(/Progress/g) != null) {
function generateBioCSV() {
var csv_data = "Assignment Type, Title, Your Score :(, Total Score :), SUM(C:C), SUM(D:D), SUM(C:C)/SUM(D:D) \n"
$('td.home_left tr').each(function() {
var $grade = $(this).find('td:nth-child(5):not(th)');
$grade = $grade.prop('outerHTML')

Keybase proof

I hereby claim:

  • I am vikranth22446 on github.
  • I am rama22446 (https://keybase.io/rama22446) on keybase.
  • I have a public key ASAB0Ei7v2BL8nsmYmO4EG_czQW1dxvYsXuEOAQ-cXKnJwo

To claim this, I am signing this object: