Skip to content

Instantly share code, notes, and snippets.

@xsolon
xsolon / Read-Write sample #1.ts
Created July 5, 2020 06:53
Native Api Samples
import * as Api from 'spexplorerjs';
import 'nativefs';
console.clear();
// @ts-ignore
//var xml = xmlEditor.getValue();
var ns: Api.Ispexplorerjs = window['spexplorerjs']
@xsolon
xsolon / php4.7.sh
Last active July 4, 2020 16:26
php 4.7 upgrade
# setup sury.org repository
apt-get install apt-transport-https -y
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/php.list
# install php7.4 modules
apt-get install -y php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip}
# install apache module
apt-get install libapache2-mod-php7.4
@xsolon
xsolon / SpDataSource.aspx
Created July 3, 2020 18:54
Minimal SpDataSource Sample
<!DOCTYPE html>
<%@ Page language="C#" %>
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint" %>
<html>
<body>
<form id="form1" runat="server">
<SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true"
UseServerDataFormat="true" selectcommand="&lt;View&gt;&lt;/View&gt;" id="spdatasource1">
@xsolon
xsolon / restMin.aspx
Created July 3, 2020 18:39
restMin.aspx
<!DOCTYPE html>
<%@ Page Language="C#" %>
<html>
<head>
<title>Test - Rest</title>
</head>
<body>
<form>
</form>
<script type="text/javascript">
<!DOCTYPE html>
<%@ Page Language="C#" %>
<html>
<head>
<title>Rest 2</title>
</head>
<body>
<form>
<input type="hidden" id="__REQUESTDIGEST" name="__REQUESTDIGEST">
</form>
@xsolon
xsolon / cachelogger.js
Created July 3, 2020 17:05
SharePoint CacheLogger
var logger = (function () {
var id = 'MartinLog';
var baseLogger = new BaseLogger.Logger(function (json) {
console.log(json);
for (d in sessionStorage) {
if (d.indexOf('id') == 0) {
sessionStorage.removeItem(d);
}
}
});
<!DOCTYPE html>
<%@ Page Language="C#" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint"%>
<html>
<head>
<title>Test - Rest</title>
</head>
<body>
<form runat="server">
</form>
</body>
<!DOCTYPE html>
<%@ Page Language="C#" %>
<%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=11" />
<title>Test - JSOM</title>
<SharePoint:ScriptLink runat="server" name="microsoftajax.js"/>
<SharePoint:ScriptLink runat="server" name="core.js"/>
@xsolon
xsolon / Inline XsltListViewWebPart
Created May 28, 2020 18:11
inline XsltListViewWebPar
<WebPartPages:XsltListViewWebPart Visible="false" runat="server" ViewFlag="" JSLink="../siteassets/app2/js/request.view.csr1.js" ViewSelectorFetchAsync="False" InplaceSearchEnabled="False" ServerRender="False" ClientRender="True" InitialAsyncDataFetch="False" WebId="00000000-0000-0000-0000-000000000000" IsClientRender="False" GhostedXslLink="main.xsl" NoDefaultStyle="" EnableOriginalValue="False" ViewContentTypeId="" ListUrl="" ListDisplayName="Requests" PageSize="-1" UseSQLDataSourcePaging="True" DataSourceID="" ShowWithSampleData="False" AsyncRefresh="True" ManualRefresh="True" AutoRefresh="False" AutoRefreshInterval="60" Title="Requests" FrameType="None" SuppressWebPartChrome="False" Description="" IsIncluded="True" ZoneID="FullPage" PartOrder="4" FrameState="Normal" AllowRemove="True" AllowZoneChange="True" AllowMinimize="True" AllowConnect="True" AllowEdit="True" AllowHide="True" IsVisible="True" CatalogIconImageUrl="/_layouts/15/images/itdl.png?rev=43" TitleUrl="/irm/Requests" DetailLink="/irm/Requests
@xsolon
xsolon / SpCertTrust
Created May 13, 2020 17:53
SharePoint On Premise App trust setup
# Configure Trust ----------------------------------------------------------------
$certPath = "C:\cert.cer"
$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certPath)
$appName = 'appName'
New-SPTrustedRootAuthority -Name $appName -Certificate $certificate
$realm = Get-SPAuthenticationRealm
$specificIssuerId = "11115920-1111-1111-1111-111111111111" # use lower case for GUID
$fullIssuerIdentifier = $specificIssuerId + '@' + $realm