Skip to content

Instantly share code, notes, and snippets.

View jee1mr's full-sized avatar
🏠
Working from home

Jeevan M R jee1mr

🏠
Working from home
View GitHub Profile
@jee1mr
jee1mr / small-caps.py
Created March 16, 2020 06:11
Python program for generating all possible combinations of small/upper case letters of a word
import sys
word = sys.argv[1]
n = len(word)
num_of_combs = 2**n
for i in range(num_of_combs):
num = bin(i)[2:].zfill(n) # if cat 000, 001, 010.. if jack 0000, 0001, 0010...
print(''.join([ word[index].upper() if value == '1' else word[index].lower() for index, value in enumerate(num)]))
@jee1mr
jee1mr / cowswamy_debates.txt
Created April 11, 2019 13:15
List of Prime Time Debate Titles of Republic TV featuring Arnab Goswami since May 2017
Bollywood takes sides this election, it's 616 artistes VS 907 artistes
Was Madhya Pradesh govt scheme funds diverted via Hawala?
Were funds stolen from schemes which were meant for malnourished children and pregnant mothers in Madhya Pradesh?
5 killed in a Maoist attack in Dantewada, Chhattisgarh.Why are the #UrbanNaxalsSilent?
RSS leader gunned down in Kishtwar, why are Kashmir terror apologists silent?
With the focus on the last mile, has the BJP hit home with it's vision document?
Is appeasement over development in elections 2019?
Unbelievable cash stash. Whose money was it anyway?
Was a family bribed?
Rahul Gandhi wants to muzzle media?
@jee1mr
jee1mr / gogetauto
Created July 6, 2015 14:16
Auto script for getting Go dependencies
#!/usr/bin/python
import re
import commands
build_error = commands.getoutput("go build")
print "go build errors:"
print build_error
sources = re.findall(r"cannot find package \"[a-zA-Z.\/]*\"",build_error)
@jee1mr
jee1mr / ST_Lab_Triangle_Problem.py
Last active August 29, 2015 14:15
ISE-6th Sem ST_Lab_Program_1
import sys
try:
x,y,z = map(int,raw_input().split())
except ValueError:
print "Invalid Input"
sys.exit(0)
if not (x<y+z and y<x+z and z<x+y):
print "Triangle cannot be formed"
else:
@jee1mr
jee1mr / quora_sneak.js
Created November 26, 2014 11:24
Paste this on your browser developer console and hit enter. You can continue reading quora answers without any hassle
var divs = document.getElementsByTagName("div");
var x = []
for(var i=0;i<divs.length;i++){
if(divs[i].id.match(/.*modal_signup_wrapper/i)){
x=divs[i].id.match(/.*modal_signup_wrapper/i);
}
}
document.getElementById(x[0]).hidden=true;
@jee1mr
jee1mr / htmlizer.py
Last active August 29, 2015 14:09
Puts all the images in a folder to the html file and opens it in a web browser
from glob import glob
import webbrowser
images = glob("*.jpg") + glob("*.png")
images.sort()
f = open("comic.html","w")
imgbegin = "<img src='"
imgend = "'>"
for src in images: