Skip to content

Instantly share code, notes, and snippets.

View Zerg00s's full-sized avatar
🏠
Working from home

Denis Molodtsov Zerg00s

🏠
Working from home
View GitHub Profile
# ================================================================================================== #
# Prerequisites
# ================================================================================================== #
# Install-Module SharePointPnPPowerShellOnline -Scope CurrentUser
# Install-Module -Name Az -Repository PSGallery -Force -Scope CurrentUser
# ================================================================================================== #
# ================================================================================================== #
# Parameters
@Zerg00s
Zerg00s / Get-List-Fields.js
Created October 15, 2023 22:38
Working with SharePoint rest using REST api and browser console
// Get SharePoint List Fields in a table
function getListSchema(listName) {
var siteUrl = _spPageContextInfo.webAbsoluteUrl;
var endpointUrl = `${siteUrl}/_api/web/lists/getbytitle('${listName}')/fields?$filter=Hidden eq false`;
fetch(endpointUrl, {
method: 'GET',
headers: {
'Accept': 'application/json;odata=nometadata',
'Content-Type': 'application/json;odata=verbose',
@Zerg00s
Zerg00s / Cognitive Search API - SharePoint Data Source.json
Last active November 22, 2024 15:48
Cognitive Search API - SharePoint Data Source - Reusable Postman collection
{
"info": {
"_postman_id": "7f9a258e-feee-40a7-827f-760caa441e43",
"name": "Cognitive Search API Reusable",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "641744"
},
"item": [
{
"name": "Create SharePoint Data Source",
@Zerg00s
Zerg00s / test
Created June 15, 2023 01:33
sql test
SELECT
last_user_update
FROM
sys.dm_db_index_usage_stats
WHERE
database_id = DB_ID('BOP') AND
OBJECT_ID=OBJECT_ID('TempUsers')
@Zerg00s
Zerg00s / hide.js
Created May 13, 2023 03:25
Hide Links
document.addEventListener('DOMContentLoaded', function() {
var linksToHide = document.querySelectorAll('a.link-to-hide');
for (var i = 0; i < linksToHide.length; i++) {
var linkText = linksToHide[i].textContent || linksToHide[i].innerText;
if (linkText === 'Links' || linkText === 'Liens') {
linksToHide[i].style.display = 'none';
}
}
});
{"LastCopyTime":"2023-04-29T19:45:46.7675207+00:00","CopiedDataKind":0,"Data":"{\"SourceDocumentVersion\":\"1.330\",\"ClientSessionId\":\"a0c7c6e9-5f02-435f-b39e-99b798283ef8\",\"CorrelationId\":\"d5c65ece-c939-4618-81c2-be51697537fe\",\"Entities\":[{\"Type\":\"ControlInfo\",\"Name\":\"StartButton\",\"HasDynamicProperties\":false,\"Template\":{\"Id\":\"http://microsoft.com/appmagic/button\",\"Version\":\"2.2.0\",\"LastModifiedTimestamp\":\"0\",\"Name\":\"button\",\"FirstParty\":true,\"IsPremiumPcfControl\":false,\"IsCustomGroupControlTemplate\":false,\"CustomGroupControlTemplateName\":\"\",\"IsComponentDefinition\":false,\"OverridableProperties\":{}},\"Index\":0.0,\"PublishOrderIndex\":3,\"VariantName\":\"\",\"LayoutName\":\"\",\"MetaDataIDKey\":\"\",\"PersistMetaDataIDKey\":false,\"IsFromScreenLayout\":false,\"StyleName\":\"defaultButtonStyle\",\"Parent\":\"WelcomeScreen\",\"IsDataControl\":false,\"AllowAccessToGlobals\":true,\"IsGroupControl\":false,\"IsAutoGenerated\":false,\"Rules\":[{\"Property\":\"Text\
@Zerg00s
Zerg00s / Disable-LUA.ps1
Created April 25, 2023 18:29
Disable LUA
$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
$keyName = "EnableLUA"
$desiredValue = 0
try {
if (Test-Path $registryPath) {
$currentValue = Get-ItemProperty -Path $registryPath -Name $keyName -ErrorAction Stop
if ($currentValue.$keyName -ne $desiredValue) {
Set-ItemProperty -Path $registryPath -Name $keyName -Value $desiredValue -ErrorAction Stop
Write-Host "The value of '$keyName' has been set to $desiredValue."
@Zerg00s
Zerg00s / Move-Mouse.ps1
Created March 29, 2023 19:38
Move Mouse. Script for juggling mouse cursor
# Load user32.dll
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class User32 {
[DllImport("user32.dll", SetLastError=true)]
public static extern bool SetCursorPos(int x, int y);
[DllImport("user32.dll")]
@Zerg00s
Zerg00s / readme.md
Created February 22, 2023 22:30
SharePoint Online - Python - Client ID and Client Secret sample
@Zerg00s
Zerg00s / OpenAI Response Schema.json
Created February 19, 2023 00:50
Open AI - Teams Chat Bot
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"object": {
"type": "string"
},
"created": {