Skip to content

Instantly share code, notes, and snippets.

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

Oyetoke Tobiloba CITGuru

🏠
Working from home
View GitHub Profile
from api import get_order, get_orders, create_orders
from auth import get_api
import sys
import click
from cli import take_user_order
api_key = get_api()
@click.group()
@click.version_option("1.0.0")
# cli.py
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import six
import os, re
from PyInquirer import style_from_dict, Token, prompt, print_json, Separator
from PyInquirer import Validator, ValidationError
from pprint import pprint
try:
# auth.py
import akeyless_proxy_api # import our installled module
from api import request_api_key
# Setup our configuration
api_conf = akeyless_proxy_api.Configuration()
api_conf.host = "rest.akeyless-security.com"
# create an instance of the Proxy API class
from setuptools import setup, find_packages
from io import open
from os import path
import pathlib
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
@CITGuru
CITGuru / .gitignore
Created June 8, 2020 07:31
python .gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
import sys
import click
from cver.scraper import search as cve_search, lookup_cve
@click.group()
@click.version_option("1.0.0")
def main():
"""A CVE Search and Lookup CLI"""
pass
@CITGuru
CITGuru / cve_scraper.py
Created June 8, 2020 05:54
CVE Web Scraper
import requests
from bs4 import BeautifulSoup
SEARCH_URL = "https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword="
CVE_URL = "https://cve.mitre.org/cgi-bin/cvename.cgi?name="
def get_html(url):
request = requests.get(url)
if request.status_code == 200:
@CITGuru
CITGuru / axiosInterceptor.js
Created May 7, 2020 13:55 — forked from nzvtrk/axiosInterceptor.js
Axios create/recreate cookie session in node.js enviroment
/* Basic example of save cookie using axios in node.js and recreate session if it expired.
* Get/save cookie manually cause WithCredential axios param use XHR and not work in node.js
* Supports parallel request and send only one create session request.
* */
const BASE_URL = "https://google.com";
// Init instance of axios which works with BASE_URL
const axiosInstance = axios.create({ baseURL: BASE_URL });
const chai = require("chai");
const chaiHttp = require("chai-http");
const expect = chai.expect
const baseUrl = "https://store-ordering-api.herokuapp.com"
// const baseUrl = "localhost:3200/"
chai.use(chaiHttp);
describe("Food Ordering API Unit Test", function(){
var token;
import timeit
print("Toby")
print("https://gist.github.com/CITGuru/699a5513e82cc610884cb61c7c4509ab")
code_to_test = """
import math
def solution(area):
a = []