Skip to content

Instantly share code, notes, and snippets.

Shrinivasan T tshrinivasan

Block or report user

Report or block tshrinivasan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tshrinivasan
tshrinivasan / parse-voter-list.py
Created Oct 3, 2019
Code to parse voter list pdf - ocred by tesseract
View parse-voter-list.py
import sys
in_file = sys.argv[1]
content = open(in_file).read()
out = open("result.csv","a")
con = content.split("வாக்காளர்‌ பெயர்‌")
View OverPassToGoogleSheet.gs
//var langCode ='ta'; -- TODO Make it language independent.
function doGet() {
return HtmlService.createTemplateFromFile('Index.html')
.evaluate();
}
function doSomething() {
Logger.log('I was called!');
}
@tshrinivasan
tshrinivasan / remove_strings_from_files.py
Created Mar 31, 2019
#This program helps to remove the given words in a file to all the files inside a directory, recursively. # Got the sed idea from http://www.linuxask.com/questions/replace-multiple-strings-using-sed
View remove_strings_from_files.py
#This program helps to remove the given words in a file to all the files inside a directory, recursively.
# Got the sed idea from http://www.linuxask.com/questions/replace-multiple-strings-using-sed
import sys
import glob
import os
import argparse
parser = argparse.ArgumentParser()
@tshrinivasan
tshrinivasan / வேர்ச்சொல்_வடிகட்டி.py
Created Mar 1, 2019
வேர்ச்சொல்_வடிகட்டி.py
View வேர்ச்சொல்_வடிகட்டி.py
from tamilstemmer import TamilStemmer
wordlist = [u'மலைகள்',u'பாடுதல்',u'ஓடினான்']
#expected = [u'மலை',u'பாடு', u'ஓடி']
ta_stemmer = TamilStemer()
for word in wordlist:
ta_stemmer.stemWord(word)
View clean-html.py
import lxml.html.clean as clean
from BeautifulSoup import BeautifulSoup
input_file = 'input.html'
output_file = 'output.html'
orig_content = open(input_file, 'rw').read()
@tshrinivasan
tshrinivasan / split-page.py
Last active Sep 14, 2019
Split a PDF vertically, used for scanned double sided PDF pages
View split-page.py
# Source http://stackoverflow.com/a/15741856/1301753
import copy
import sys
import math
import pyPdf
def split_pages(src, dst):
src_f = file(src, 'r+b')
dst_f = file(dst, 'w+b')
@tshrinivasan
tshrinivasan / CSS for FreeTamilEbooks.com
Last active Aug 29, 2015
CSS for FreeTamilEbooks.com
View CSS for FreeTamilEbooks.com
<style type="text/css">
body {
background: white;
font-size: 12pt;
}
strong,h3,h4{
font-weight: 900;
color:midnightblue;
}
View gist:3682456
import mechanize
import cookielib
# http://stockrt.github.com/p/emulating-a-browser-in-python-with-mechanize/
# Browser
br = mechanize.Browser()
# Cookie Jar
cj = cookielib.LWPCookieJar()
You can’t perform that action at this time.