Skip to content

Instantly share code, notes, and snippets.

import bluetooth
import struct
import time
from machine import Pin, ADC
from micropython import const
# Set up the ADC to read the temperature sensor
adc = ADC(4)
conversion_factor = 3.3 / (65535)
{
"projectFileVersion": "2022-10-01-preview",
"stringIndexType": "Utf16CodeUnit",
"metadata": {
"projectKind": "Conversation",
"settings": {
"confidenceThreshold": 0,
"normalizeCasing": false
},
"projectName": "Clock",
Write-Host "This will show the Path column to your view"
Write-Host "To do, please copy the edit view you want to update."
Write-Host "Here is how it can look: "
Write-Host "https://contoso.sharepoint.com/sites/site/_layouts/15/ViewEdit.aspx?View=%7B6987F436%2DA89E%2D4F96%2DA791%2D02D6988EE09B%7D&List=%7BFE190210%2D2EA0%2D4A69%2DB3F4%2D9CE412F154F1%7D&Source=%2Fsites%2FSE%2D000858%2FUE%2FForms%2FPlatt%20vy%2Easpx"
$link = Read-Host "Please paste the edit view"
Write-Host "Great, this is an early version and it has no validation, neither checks it whether the Path is already shown or not"
Write-Host "Feel free to reach out to @mirontoli to give feedback or contribute"
$site = $link.Split("/_layouts/15")[0]
Connect-PnPOnline $site -Interactive
//Slightly adjusted from https://github.com/pnp/pnpcore/blob/dev/samples/Demo.Console.Minimal/Program.cs
//The goal is to send an email using Graph API and by authenticating through PnP Management Shell
//Without a custom app registration
//corresponding commands: https://pnp.github.io/cli-microsoft365/cmd/outlook/mail/mail-send/
//and
using AngleSharp.Dom;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using PnP.Core.Auth;
using PnP.Core.Services;
# for downloading pictures
# first, export gedcom
$urls = gc ".....ged" | ? { $_ -match "2 FILE " } | % { $_.Replace("2 FILE ", "") }
$urls | % { Start-BitsTransfer $_ }
#open in code and replace and strip https parts leaving only filenames by using this regex:
# https:\/\/.*[^\/]\/
# emilie pixel art created
# using https://minecraftart.netlify.app/editor
# some blocks needed to be renamed
# saved in a datapack
# %appdata%/.minecraft/saves/pixelart002/datapacks/tolle/data/custom/functions/emilie003.mcfunction
# create even %appdata%/.minecraft/saves/pixelart002/datapacks/tolle/pack.mcmeta w content:
# {"pack":{"pack_format": 7,"description": "<Description>"}}
fill ~ ~ ~-1 ~ ~1 ~-1 minecraft:gray_concrete
fill ~ ~ ~-2 ~ ~ ~-3 minecraft:clay
fill ~ ~ ~-4 ~ ~1 ~-4 minecraft:gray_concrete
#trying out https://www.svenmalvik.com/azure-apim-with-eventhub/
# start azure cloud shell powershell
New-AzResourceGroup -Name "apim101-rg" -Location "West Europe"
New-AzApiManagement -ResourceGroupName "apim101-rg" -Name "svenmalvik-apim" -Sku "Consumption" -Capacity 0 -Location "West Europe" -Organization "chuvash.eu" -AdminEmail "[email protected]"
# The context tells us what instance of APIM we're working with
$apimCtx = New-AzApiManagementContext -ResourceGroupName "apim101-rg" -ServiceName "svenmalvik-apim"
# Add Conference API to the APIM instance
Import-AzApiManagementApi -Context $apimCtx -SpecificationFormat "Swagger" -SpecificationUrl "https://conferenceapi.azurewebsites.net?format=json" -Path "conf" -ApiId "confapi"
$auth = "apitest:j2vsnu3obx55ekwjkfdxfpljziiy27qkuku5jitsx73wvegpdpeq"
$bytes = [System.Text.Encoding]::ASCII.GetBytes($auth)
$token = [System.Convert]::ToBase64String($bytes)
$headers = @{ Authorization = "Basic $token" }
code --list-extensions
code --install-extension esbenp.prettier-vscode
# I use SPO Admin a lot, change it to your desired role
$roleToActivate = "SharePoint Administrator"
# default 2 hours, update it to your needs
$hours = 2
$reason = Read-Host "Justify your elevation"
$connection = Connect-AzureAD
$account = $connection.Account
$tenantId = $connection.TenantId
$user = Get-AzureADUser -SearchString $account
$objectId = $user.ObjectId