This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class | |
# C extensions | |
*.so | |
# Distribution / packaging | |
.Python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
print("Toby") | |
print("https://gist.github.com/CITGuru/699a5513e82cc610884cb61c7c4509ab") | |
code_to_test = """ | |
import math | |
def solution(area): | |
a = [] |
NewerOlder