Skip to content

Instantly share code, notes, and snippets.

View baywet's full-sized avatar
🏬
Working from home

Vincent Biret baywet

🏬
Working from home
View GitHub Profile
This file has been truncated, but you can view the full file.
---
0 warn pnpm:
message: "using --force I sure hope you know what you are doing"
prefix: "C:\\sources\\gitttl\\SiteCreation\\SiteCreationForm"
1 info pnpm:
message: "Installing a flat node_modules. Use flat node_modules only if you rely on buggy dependencies that you cannot fix."
prefix: "C:\\sources\\gitttl\\SiteCreation\\SiteCreationForm"
2 debug pnpm:package-json:
initial:
name: "site-creation-form"
param([String]$version)
Install-PackageProvider -Name NuGet -Force -Scope "CurrentUser"
if($version -ne "") {
Install-Module SharePointPnPPowerShellOnline -Scope "CurrentUser" -RequiredVersion $version -Verbose -AllowClobber -Force
} else {
Install-Module SharePointPnPPowerShellOnline -Scope "CurrentUser" -Verbose -AllowClobber -Force
}
import { ACTIVITY_TYPE_DIGITAL, DIGITAL_CATEGORY_EMAIL } from '../../definitions';
export const modelName = 'email';
export const modelVersion = '1';
export const explanation = {
text:
'Calculations take into account the direct emissions associated with the email infrastructure worldwide.',
links: [
{
label: 'Phys.org (2015)',
@baywet
baywet / testScript.ps1
Created September 8, 2021 13:36
AGS request payload compression test
$accessToken = "<AccessTokenWithMailSendPermission>"
$srcFileName = "PathToRequestPayloadUncompress-SeeOtherFile"
$destFileName = "APath"
$srcFileStream = New-Object System.IO.FileStream($srcFileName,([IO.FileMode]::Open),([IO.FileAccess]::Read),([IO.FileShare]::Read))
$destFileStream = New-Object System.IO.FileStream($destFileName,([IO.FileMode]::Create),([IO.FileAccess]::Write),([IO.FileShare]::None))
$gzip = New-Object System.IO.Compression.GZipStream($destFileStream,[System.IO.Compression.CompressionMode]::Compress)
$gzip.CopyTo($srcFileStream)
$gzip.Flush()
$destFileStream.Dispose()
Invoke-WebRequest -UseBasicParsing -Uri "https://graph.microsoft.com/v1.0/me/sendMail" `
@baywet
baywet / app.go
Created November 18, 2021 21:02
ms graph go beta sdk
import (
azidentity "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
a "github.com/microsoft/kiota/authentication/go/azure"
"context"
// this line imports the v1.0 SDK
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
// this line imports the beta SDK
msgraphbetasdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
)
@baywet
baywet / app.go
Last active November 23, 2021 13:22
Sample for the go sdk preview announcement
import (
azidentity "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
a "github.com/microsoft/kiota/authentication/go/azure"
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
)
// the following block creates a new device code credential using the Azure Identity library which will be used by the authentication provider to obtain an access token for requests
cred, err := azidentity.NewDeviceCodeCredential(&azidentity.DeviceCodeCredentialOptions{
@baywet
baywet / app.go
Last active November 29, 2021 17:49
msgraph go sdk fluent api demo
// indexes into the users and message folders collections using the fluent style API to list out messages
client.UserById("jane@contoso.com").MessageFoldersById("Inbox").Messages().Get(nil)
// sends a message using the models and the fluent style API POST method
requestBody := msgraphsdk.NewSendMailRequestBody()
message := msgraphsdk.NewMessage()
requestBody.SetMessage(message)
subject := "Meet for lunch?"
message.SetSubject(&subject)
body := msgraphsdk.NewItemBody()
@baywet
baywet / MS Graph Change Notifications useful links.txt
Created October 1, 2020 12:23
Microsoft Graph Change Notifications useful links
@baywet
baywet / pfxtosnk.cs
Created October 4, 2014 00:39
sample on how to convert a pfx to snk visual studio assembly signing certificate
X509Certificate2 cert = new X509Certificate2(@"KEY.pfx", "pfxPassword", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
RSACryptoServiceProvider provider = (RSACryptoServiceProvider) cert.PrivateKey;
byte[] array = provider.ExportCspBlob(!provider.PublicOnly);
using (FileStream fs = new FileStream("FileName.snk", FileMode.Create, FileAccess.Write))
{
fs.Write(array, 0, array.Length);
}
@baywet
baywet / build.gradle
Created February 7, 2024 19:42 — forked from maisarissi/build.gradle
microsoftgraph-java-v6-sefl-serve-kiota-build-gradle
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit test framework.
testImplementation libs.junit
// This dependency is used by the application.