Skip to content

Instantly share code, notes, and snippets.

Required APIs

General Requirements from all api's in doc

  • api end point and type
  • description
  • url inputs (params)
  • data inputs (body)
  • sample output json - correct (status code 200)
  • sample output json - error case (with status code)
  • Headers required for auth/other purposes
#!/usr/local/bin/python3
# generic test case maker for hacker rank questions
from __future__ import print_function
from enum import Enum
import random
from lorem.text import TextLorem
from datetime import datetime
from random import randrange
from datetime import timedelta
import string
#!/usr/local/bin/python3
# generic test case maker for hacker rank questions
from __future__ import print_function
from enum import Enum
import random
# import lorem
# import nltk
from datetime import datetime
from random import randrange
from datetime import timedelta
#!/usr/local/bin/python
# generic test case maker for hacker rank questions
from __future__ import print_function
from enum import Enum
import random
# Input types, Attributes
# INT : minVal, maxVal, name
# STATIC: value
# LOOP: length, elements (list of other inputs)
#!/usr/local/bin/python
# generic test case maker for hacker rank questions
from enum import Enum
import random
# Input types, Attributes
# Int : range (2 tuple),
defaults = {
"intMinVal": 1,
#!/usr/local/bin/python
from lorem.text import TextLorem
import random
import time
from datetime import datetime
def genDate():
d = random.randint(1, int(time.time()))
return datetime.fromtimestamp(d).strftime('%d-%m-%Y')
#!/usr/bin/env python3
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup
cacheNumbers = {
'times' : '6821',
import webbrowser
import subprocess
import os, shutil
from pygit2 import Repository
import win32api
import requests
import filecmp
import globalConstants
servicePack = globalConstants.currentAdminConsoleWorkspace
#!/usr/bin/env python3
from random import randint
class Logic:
def __init__(self, board, me):
self.board = board
self.me = me
self.opp = 1 if me==2 else 2
def clean(self,move):
@moonblade
moonblade / p
Last active April 26, 2017 16:41
print command for lab
#!/bin/bash
if [ -z $1 ]
then echo "PLEASE USE : p <rollNo>"
fi
# Get the current folder name, here it will be s13 or s14 etc
currentFolder=${PWD##*/}
# Input to the program will be a two digit roll number.
rollNumber=$1
# Full roll no is the roll number along with the folder, eg s1380