Skip to content

Instantly share code, notes, and snippets.

View Sealjay's full-sized avatar
😄

Chris Lloyd-Jones Sealjay

😄
View GitHub Profile
@Sealjay
Sealjay / .env
Created February 10, 2021 01:00
bingnews-cli - .env example
BING_SEARCH_KEY=<the search key you copied earlier>
BING_SEARCH_ENDPOINT=https://api.bing.microsoft.com/
@Sealjay
Sealjay / request-example.py
Last active February 10, 2021 01:36
bingnews-cli - request example
import os
import textwrap
import requests
import pyshorteners
from tabulate import tabulate
def clean_trending_article_dictionary(article_dictionary):
"""Take a dictionary for a trending article, and tweak the output."""
@Sealjay
Sealjay / click-example.py
Created February 10, 2021 01:39
bingnews-cli - click example
import click
@click.group()
def cli():
"""A CLI to search for news articles using Bing News, and return appropriate articles."""
@cli.command("phrase")
@click.option("-p", "--search_phrase", prompt="What phrase are you searching for?")
def search_bing_by_phrase(search_phrase):
@Sealjay
Sealjay / cognitivesearch-diagram.py
Created February 10, 2021 15:39
cognitivesearch - diagram
# URL: www.sealjay.com/unlocking-content-with-summaries-and-insight/
from diagrams import Cluster, Diagram, Edge
from diagrams.programming.language import Csharp, Python
from diagrams.azure.ml import CognitiveServices
from diagrams.azure.web import Search, AppServices, AppServicePlans
from diagrams.azure.storage import BlobStorage
from diagrams.azure.integration import LogicApps
from diagrams.generic.storage import Storage
from diagrams.azure.compute import FunctionApps
from diagrams.onprem.compute import Server
@Sealjay
Sealjay / tests.md
Created February 11, 2021 19:59
teamsvid-asynctest

async def main(): video_indexer = await AsyncVideoIndexer.create( os.environ.get("VIDEO_INDEXER_ACCOUNT_ID"), os.environ.get("VIDEO_INDEXER_KEY"), os.environ.get("VIDEO_INDEXER_ACCOUNT_LOCATION"), )

video_to_upload = (

@Sealjay
Sealjay / example.py
Last active February 18, 2021 23:28
aio-videoindexer - get started
from asyncvideoindexer import AsyncVideoIndexer
VIDEO_INDEXER_ACCOUNT_ID = "your-account-id"
VIDEO_INDEXER_KEY = "your-account-key"
VIDEO_INDEXER_ACCOUNT_LOCATION = "your-account-location"
async def get_video_indexer():
video_indexer = await AsyncVideoIndexer.AsyncVideoIndexer.create(
VIDEO_INDEXER_ACCOUNT_ID,
@Sealjay
Sealjay / document_indexer.json
Last active March 3, 2021 01:24
cognitivesearch - indexer
{
"name": "docindexer",
"description": null,
"dataSourceName": "docs",
"skillsetName": "mergetext",
"targetIndexName": "uklegislation",
"disabled": null,
"schedule": null,
"parameters": {
"batchSize": null,
@Sealjay
Sealjay / skillset.json
Created March 3, 2021 01:31
cognitivesearch - ai skillset - merge text
{
"name": "mergetext",
"description": "Extract text from images and merge with content text to produce merged_text",
"skills": [
{
"@odata.type": "#Microsoft.Skills.Vision.OcrSkill",
"name": "#1",
"description": "Extract text (plain and structured) from image.",
"context": "/document/normalized_images/*",
"textExtractionAlgorithm": null,
@Sealjay
Sealjay / datamodel.MD
Last active May 7, 2021 16:25
kaiterra-data-model

Telemetry

    public class KaiterraTelemetry
    {
        public string Param {get;set;}
        public string Units{get;set;}
        public int Span {get;set;}

        public KaiterraTelemetryPoint[] Points {get;set;}
@Sealjay
Sealjay / oss-compliance.yml
Created September 21, 2021 14:31
github-actions - oss-compliance.yml
name: OSS Licence Compliance
on:
workflow_dispatch:
pull_request:
types: [assigned, opened, reopened]
push:
branches:
- main
paths-ignore:
- "docs/**"