Skip to content

Instantly share code, notes, and snippets.

View sebastienlevert's full-sized avatar
🦒

Sébastien Levert sebastienlevert

🦒
View GitHub Profile
@sebastienlevert
sebastienlevert / request-builder.md
Created July 6, 2022 19:51
Request Builder sample for Microsoft Graph PHP SDK 2.0.0-RC5
// v1.x
$response = $graphClient->createRequest('GET', '/users/userId/messages')
                        ->setReturnType(Model\User::class)
                        ->execute();

// v2.0-RC
$response = $graphServiceClient->usersById('userId')->messages()->get()->wait();
@sebastienlevert
sebastienlevert / auth.md
Last active July 6, 2022 19:50
Auth sample for Microsoft Graph PHP SDK 2.0.0-RC5
// v1.x
$accessToken = getAccessToken(); // custom token retrieval method
$graph = new Graph();
$graph->setAccessToken($accessToken);


$graph ->createRequest('GET', '/me')
       ->setAccessToken(getAccessToken()) //after initial token expires
 ...
@sebastienlevert
sebastienlevert / app.cs
Last active May 26, 2022 16:32
Samples for the Graph SDK Build 2022 Announcement
// Sample for .NET
var graphClient = new GraphServiceClient(credential, scopes);
var result = await graphClient.Me.Drive.GetAsync();
# Connecting to your tenant
Connect-PnPOnline -Url https://tenant.sharepoint.com
# Getting the list of pages utilizing the Learning Pathways web part
Submit-PnPSearchQuery -Query "FileExtension:aspx 141d4ab7-b6ca-4bf4-ac59-25b7bf93642d" -All -RelevantResults | Select-Object OriginalPath
# Connecting to your tenant
Connect-PnPOnline -Url https://tenant.microsoft.com
# Creating the Modern Site
New-PnPTenantSite `
-Title "Modern Site" `
-Url "https://tenant.sharepoint.com/sites/modern-site" `
-Description "Modern Site" `
-Owner "admin@tenant.onmicrosoft.com" `
-Lcid 1033 `
import { AngularMaterial } from './angular-material';
import { NgModule } from '@angular/core';
import { MatToolbarModule } from '@angular/material';
import { BrowserModule } from '@angular/platform-browser';
import { CommonModule } from '@angular/common';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { Environment, EnvironmentType } from '@microsoft/sp-core-library';
/**
* Module that intializes our Angular Element
import { Component, Input, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'angular-material',
templateUrl: 'angular-material.html',
styleUrls: [ 'angular-material.scss' ],
encapsulation: ViewEncapsulation.None
})
export class AngularMaterial {
@Input() public name: string;
/* fallback */
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local('Material Icons'), local('MaterialIcons-Regular'), url(https://fonts.gstatic.com/s/materialicons/v17/2fcrYFNaTjcS6g4U3t-Y5ZjZjT5FdEJ140U2DJYC3mY.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
<div class="example-container mat-elevation-z8">
<mat-toolbar color="primary">
<mat-toolbar-row>
<span>{{ name }}</span>
</mat-toolbar-row>
</mat-toolbar>
</div>
{
"name": "spfx-ng-webparts",
"version": "0.0.1",
"private": true,
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",