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
@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 click
import requests
__author__ = "Oyetoke Toby"
@click.group()
def main():
"""
Simple CLI for querying books on Google Books by Oyetoke Toby
"""
@CITGuru
CITGuru / emailcli.py
Last active September 26, 2022 21:53
EmailCLI - A Python Command Line App for sending mails using SendGrid
import os
import re
import click
import sendgrid
import six
from pyconfigstore import ConfigStore
from PyInquirer import (Token, ValidationError, Validator, print_json, prompt,
style_from_dict)
from sendgrid.helpers.mail import *
@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:
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()