Skip to content

Instantly share code, notes, and snippets.

View bechynsky's full-sized avatar
😺

Štěpán Bechynský bechynsky

😺
  • Microsoft
  • Prague, Czech republic
  • X @stepanb
View GitHub Profile
@bechynsky
bechynsky / 1itg_thumbnail.bat
Created January 2, 2021 12:40
Using curl util to call Cognitive Services Vision REST API for Generate Thumbnail
curl -H "Ocp-Apim-Subscription-Key: {KEY}" -H "Content-Type: application/json" "https://{LOCATION}.api.cognitive.microsoft.com/vision/v3.1/generateThumbnail?width=100&height=100&smartCropping=true" -d "{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/thumb/5/56/Shorkie_Poo_Puppy.jpg/1280px-Shorkie_Poo_Puppy.jpg\"}" -o small_dog.jpg
@bechynsky
bechynsky / ad.scala
Last active January 19, 2021 08:52
DP-200 Module 3 Lab 3 Exercise 3 Task 4
//From Storage Account
// Azure Storage Account name <storage-account-name>
var storage_account_name = ""
// <file-system-name>
var file_system_name = "logs"
// From AD
// Application (client) ID <application-id>
var application_id = ""
// Key <authentication-key> for application
@bechynsky
bechynsky / Program.cs
Created January 2, 2021 12:17
Example how to call Cognitive Services Vison REST API
using System;
using System.Net;
using System.Text;
namespace VisionDemo
{
class Program
{
private const string LOCATION = "";
private const string KEY = "";
@bechynsky
bechynsky / 1itg_greeting.py
Last active January 2, 2021 12:27
Example how displays work 1itg_greeting.py
from sense_hat import SenseHat
sense = SenseHat()
sense.show_message("1. IT Gymnazium", text_colour = (0, 255, 0))
@bechynsky
bechynsky / 1itg_smile.py
Last active January 2, 2021 12:13
Example how displays work 1itg_smile.py
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0) # red
g = (0, 255, 0) # green
b = (0, 0, 255) # blue
w = (255,255,255) # white
e = (0,0,0) # empty, no light - black
# 8x8 matrix RGB display
@bechynsky
bechynsky / 1itg_line.py
Last active January 2, 2021 12:14
Example how displays work 1itg_line.py
from sense_hat import SenseHat
sense = SenseHat()
r = (255, 0, 0) # red
g = (0, 255, 0) # green
b = (0, 0, 255) # blue
w = (255,255,255) # white
e = (0,0,0) # empty, no light - black
# 8x8 matrix RGB display