Skip to content

Instantly share code, notes, and snippets.

View p53ud0k0d3's full-sized avatar

Vishnu Ashok p53ud0k0d3

View GitHub Profile
@p53ud0k0d3
p53ud0k0d3 / read-in-an-array.sh
Created March 19, 2015 13:27
HackerRank Read In An Array
i=0
while read x
do
arr[$i]=$x
i=$i+1
done
echo ${arr[@]}
@p53ud0k0d3
p53ud0k0d3 / arithmetic-operations.sh
Created March 19, 2015 12:47
HackerRank Arithmetic Operations
read input
printf "%.3f\n" `echo "$input" | bc -l`
@p53ud0k0d3
p53ud0k0d3 / more-on-conditionals.sh
Created March 19, 2015 12:31
HackerRank More On Conditionals
read x
read y
read z
if [ $x -eq $y -a $x -eq $z ]
then
echo "EQUILATERAL"
elif [ $x -ne $y -a $x -ne $z -a $y -ne $z ]
then
echo "SCALENE"
else
@p53ud0k0d3
p53ud0k0d3 / the-love-letter-mystery.py
Created March 19, 2015 11:46
HackerRank The Love-Letter Mystery
words = []
def evenPal(word):
steps = 0
l = len(word)
w1 = word[:l/2]
w2 = word[l/2:]
w2 = w2[::-1]
for i in xrange(0, len(w1)):
steps += abs(ord(w1[i]) - ord(w2[i]))
@p53ud0k0d3
p53ud0k0d3 / Hackerrank-Handshake.py
Created March 18, 2015 18:12
HackerRank Handshake
people = []
for _ in range(int(raw_input())):
people.append(int(raw_input()))
for n in people:
print ((n*(n-1))/2)
@p53ud0k0d3
p53ud0k0d3 / Hackerrank-Minimum-draws.py
Created March 18, 2015 18:05
HackerRank Minimum Draws
pairs = []
for _ in xrange(int(raw_input())):
pairs.append(int(raw_input()))
for item in pairs:
print item+1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from google.appengine.api import urlfetch
result = urlfetch.fetch("http://software.sopili.net/")
result.content
#Python 2
python -m SimpleHTTPServer 8080
#Python 3
python3 -m http.server 8113
@p53ud0k0d3
p53ud0k0d3 / python-mailer.py
Last active August 24, 2023 01:58
Simple python program for sending emails from Gmail and Hotmail.
"""python-mailer.py
Author : Vishnu Ashok
Contact : [email protected]
[email protected]
GitHub : http://github.com/p53ud0k0d3
This is a simple email client program, which can be used to send emails from Gmail and Hotmail.
You must enable "Allow less secure apps" in Gmail settings.
"""