Skip to content

Instantly share code, notes, and snippets.

View ankita-gupta-05's full-sized avatar

Ankita Gupta ankita-gupta-05

View GitHub Profile
@ankita-gupta-05
ankita-gupta-05 / postfix_calculator.py
Created March 14, 2016 11:03 — forked from sokrato/postfix_calculator.py
Postfix calculator implementation in Python, infix to postfix transformation, for theories, see http://www.smccd.net/accounts/hasson/C++2Notes/ArithmeticParsing.html
'''
Infix calculator
First tokenize infix expression,
then transform it into postfix,
then calculate it.
E.g.:
9 - 5 + 2 * 3
=> 9 5 - 2 3 * +
'''
import re
@ankita-gupta-05
ankita-gupta-05 / thankyou.py
Created April 7, 2016 07:17 — forked from naiquevin/thankyou.py
Python script to thank people who sent birthday wishes on facebook
import sys
from urllib import urlencode
import requests
from urlparse import urlparse, parse_qs
from random import choice
import re
self_id = None # your facebook id here
utc_bday = None # utc timestamp of your birthday
@ankita-gupta-05
ankita-gupta-05 / The Technical Interview Cheat Sheet.md
Created April 8, 2016 21:10 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@ankita-gupta-05
ankita-gupta-05 / littlechecker.py
Created April 18, 2016 18:25 — forked from rajarsheem/littlechecker.py
A little code checker tool in python for Java,C,Cpp. Handles compile error, runtime error, accepted, wrong, TLE.
import os, filecmp
codes = {200:'success',404:'file not found',400:'error',408:'timeout'}
def compile(file,lang):
if lang == 'java':
class_file = file[:-4]+"class"
elif lang == 'c':
class_file = file[:-2]
elif lang=='cpp':
@ankita-gupta-05
ankita-gupta-05 / http_directory.py
Created February 23, 2017 20:12 — forked from remram44/http_directory.py
Recursively download a directory with Python
from HTMLParser import HTMLParser
import urllib2
import os
import re
re_url = re.compile(r'^(([a-zA-Z_-]+)://([^/]+))(/.*)?$')
def resolve_link(link, url):
m = re_url.match(link)
@ankita-gupta-05
ankita-gupta-05 / redis_cheatsheet.bash
Created April 3, 2018 11:09 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.