Skip to content

Instantly share code, notes, and snippets.

View olafwrieden's full-sized avatar
🔥
git: Committed for life

Olaf Wrieden olafwrieden

🔥
git: Committed for life
View GitHub Profile
@olafwrieden
olafwrieden / Create_Table.kql
Last active September 14, 2022 05:21
Azure Data Explorer Power Apps Connector
// Create the Table
.create table MyTable (Title: string, Description: string, Importance: string, User: string)
// Append a sample entry
.append MyTable <|
print "Some Title", "This is a long description.", "Low", "Olaf Wrieden"
@olafwrieden
olafwrieden / function.json
Last active April 25, 2022 05:23
Azure Function SendGrid Binding - HTML Email
{
"bindings": [
{
"name": "file",
"type": "blobTrigger",
"direction": "in",
"path": "files/{name}",
"connection": "AzureWebJobsStorage"
},
{
@olafwrieden
olafwrieden / package.json
Created March 24, 2022 13:04
Sync Translation Files
{
"name": "example",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "react-scripts start",
"sync:i18n": "ts-node --project ../scripts/tsconfig.json ../scripts/syncTranslations.ts",
"build": "react-scripts build",
"test": "react-scripts test"
}
@olafwrieden
olafwrieden / CreatePurviewEntityLineage.py
Created February 21, 2022 04:19
Create Purview Lineage via Python
from pyapacheatlas.auth import ServicePrincipalAuthentication
from pyapacheatlas.auth import BasicAuthentication
from pyapacheatlas.core import PurviewClient, AtlasEntity, AtlasProcess
from pyapacheatlas.core.util import AtlasException, GuidTracker
from json import dumps
# Configure Service Principal Authentication
auth = ServicePrincipalAuthentication(
tenant_id = "xxxxxxx-xxxxxx-xxxxx-xxxxx-xxxxxxxxxx",
client_id = "xxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxx", # Client ID,
@olafwrieden
olafwrieden / pull-request-previews.yml
Created February 12, 2022 01:33
Pull Request Previews with Azure App Service & GitHub Actions
name: Pull Request Preview
on:
pull_request:
types: [opened, synchronize, closed]
branches:
- main
paths:
- "app/**"
workflow_dispatch:
@olafwrieden
olafwrieden / Landing.js
Last active October 19, 2023 02:17
React Hooks + Azure App Configuration Feature Flags
const Landing = () => {
const { config: alertMessage } = useConfiguration('Landing:Alert'); // The config key from App Config
const { enabled: showLandingAlert } = useFeatureFlag('ShowLandingAlert'); // The feature flag key from App Config
const showAlert = showLandingAlert && alertMessage.toString().trim().length;
return (
<>
{showAlert && <TopAlert color="success">{alertMessage}</TopAlert>}
@olafwrieden
olafwrieden / azure-sentiment-analysis-snippet.js
Last active August 25, 2020 11:08
Sentiment Analysis Snippets for Azure, AWS, GCP.
const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics");
const client = new TextAnalyticsClient(process.env["TEXT_ANALYSIS_ENDPOINT"], new AzureKeyCredential(process.env["TEXT_ANALYSIS_KEY"]));
module.exports = async function (context, req) {
// Extract submitted text from request body
const text = req.body && req.body.text;
if (!text) {
// Error if no text was found
return context.res = {