Skip to content

Instantly share code, notes, and snippets.

View ktskumar's full-sized avatar

Shantha Kumar T ktskumar

View GitHub Profile
@ktskumar
ktskumar / getcustomfontpackagebyid.json
Created May 17, 2024 12:54
Power Automate Response: Get Custom Font Package by ID
{
"d": {
"__metadata": {
"id": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/FontPackages/GetById('ea101761-bc64-4f8e-96f5-163c605a6041')",
"uri": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/FontPackages/GetById('ea101761-bc64-4f8e-96f5-163c605a6041')",
"type": "SP.FontPackage"
},
"ID": "ea101761-bc64-4f8e-96f5-163c605a6041",
"IsHidden": false,
"IsValid": true,
@ktskumar
ktskumar / ootbfontpackageapply.json
Created May 16, 2024 00:12
Response after apply OOTB font package
{
"d": {
"Apply": null
}
}
@ktskumar
ktskumar / listcustomfontpackages_pa_response.json
Created May 14, 2024 00:52
List Custom Font Packages deployed in SharePoint Online using Power Automate - Response Body
{
"d": {
"results": [
{
"__metadata": {
"id": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/SP.FontPackagefff39b0b-8476-4564-a678-9daac8ef29ba",
"uri": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/SP.FontPackagefff39b0b-8476-4564-a678-9daac8ef29ba",
"type": "SP.FontPackage"
},
"ID": "ea101761-bc64-4f8e-96f5-163c605a6041",
@ktskumar
ktskumar / listootbfontpackages.json
Created May 13, 2024 00:44
List OOTB font packages from SharePoint Online
{
"d": {
"results": [
{
"__metadata": {
"id": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/SP.FontPackage1708d258-0e7b-40ad-831d-53e374293ee1",
"uri": "https://<tenant>.sharepoint.com/sites/ktskumar/_api/SP.FontPackage1708d258-0e7b-40ad-831d-53e374293ee1",
"type": "SP.FontPackage"
},
"ID": "1e7a7803-045d-44df-9c7a-d2f2f8562e51",
@ktskumar
ktskumar / copy-webpart.ts
Created March 8, 2022 00:20
Copy web-part from one page to another modern page in SharePoint
/*
Below code uses the PnP JS and helps to copy the webpart from one page to another page in modern SharePoint page
*/
import { sp } from "@pnp/sp/presets/all";
(async () => {
const page = await sp.web.loadClientsidePage("/sites/portal/SitePages/page2.aspx");
const control = page.sections[1].columns[0].getControl(0);
@ktskumar
ktskumar / voice_validation.html
Last active June 13, 2022 23:40
Voice recognition and validation by comparing two speecs and determine if they are from the same speaker. Try it with your own voice!
<!DOCTYPE html>
<html>
<head>
<title>Speaker Authenticator</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/recorderjs/0.1.0/recorder.js"></script>
</head>
<body>
<div class="container">
<h1>Validate Speaker</h1>
@ktskumar
ktskumar / mgt-showgroups.html
Created December 17, 2021 10:52
HTML snippet for render groups in a responsive table
<mgt-get resource="/groups" version="v1.0" scopes="group.read" max-pages="2">
<template>
<div class="get-wrapper">
<div class="table">
<div class="row header">
<div class="cell">
Name
</div>
<div class="cell">
Email
@ktskumar
ktskumar / mgt-explorejson.html
Created December 16, 2021 14:28
Explore JSON response from mgt-get
<mgt-get resource="/me/drive" version="v1.0" scopes="file.read" max-pages="2">
<template>
<div class="objcontainer" data-for="{{a in Object.keys(this)}}">
<div class="key">{{a}}</div>
<div data-if="{{typeof(this[a]) != 'object'}}" class="value">{{this[a]}} </div>
<div data-else class="value">
<div data-for="{{b in Object.keys(this[a])}}">
<div class="key">{{b}}</div>
<div class="value">{{this[a][b]}}</div>
</div>
@ktskumar
ktskumar / mgt-profileanimation.html
Created December 7, 2021 01:41
Animate Profile using Microsoft Graph Toolkit
<mgt-person person-query="me">
<template>
<div id="outerContainer" data-if="person.personImage">
<div id="container">
<div class="item">
<img src="{{ person.personImage }}" />
</div>
<div class="circle" style="animation-delay: -3s">
</div>
<div class="circle" style="animation-delay: -2s">
@ktskumar
ktskumar / updateWriteSecurity.js
Created November 30, 2021 07:19
Change Item Level permission for SitePages Library
//Update the WriteSecurity to change the item level permissions
//Set the Edit property to Create items and edit items that were created by the user
// 1 - Create and edit all items
// 2 - Create items and edit items that were created by the user
// 3 - None
import { sp, Web } from "@pnp/sp/presets/all";
(async () => {