Skip to content

Instantly share code, notes, and snippets.

View gurusura's full-sized avatar

Gurumurthi V Ramanan gurusura

View GitHub Profile
@gurusura
gurusura / pdfcompress.py
Created April 3, 2022 05:51 — forked from ilovefreesw/pdfcompress.py
A Python script to batch compress PDF files on Windows, MAC, and Linux. Make sure gs and Python are in PATH before running this script.
from __future__ import print_function
import os
import subprocess
root = "."
try:
os.mkdir('compressed')
except FileExistsError:
pass
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Simple Hyperbolic tiling animation using taichi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import taichi as ti
ti.init(arch=ti.cpu)
# ----------------------------------------------
# global settings
@gurusura
gurusura / textbook.py
Created January 18, 2021 18:32 — forked from Evantm/textbook.py
Command line python script that scrapes TRU Bookstore then searches Libgen for that book.
import sys
from requests import get
from bs4 import BeautifulSoup
# Put in your class details. It scans TRU bookstore to get ISBN
# It uses the ISBN to search Libgen to get MD5
# It then downloads from Libgen using the MD5
def make_request(url):
headers = {
'Host': 'thebookstore.tru.ca',
'Connection': 'keep-alive',
@gurusura
gurusura / simulator.py
Created December 21, 2020 13:08 — forked from markusrenepae/simulator.py
This gist is for another medium article and is about an investment simulator.
import pandas as pd
import numpy as np
import datetime as dt
import math
import warnings
warnings.filterwarnings("ignore")
prices = pd.read_csv("adjclose.csv", index_col="Date", parse_dates=True)
volumechanges = pd.read_csv("volume.csv", index_col="Date", parse_dates=True).pct_change()*100
#-*- coding:utf-8 - *-
def load_dataset():
"Load the sample dataset."
return [[1, 3, 4], [2, 3, 5], [1, 2, 3, 5], [2, 5]]
def createC1(dataset):
"Create a list of candidate item sets of size one."