Skip to content

Instantly share code, notes, and snippets.

View rjesh-git's full-sized avatar
🚀

Rajesh Sitaraman rjesh-git

🚀
View GitHub Profile
Add-Type -Path "Microsoft.SharePoint.Client.dll"
Add-Type -Path "Microsoft.SharePoint.Client.Runtime.dll"
try {
$rendition = New-Object Microsoft.SharePoint.Client.Publishing.ImageRendition
$rendition.Name = $Title
$rendition.Width = $Width
$rendition.Height = $Height
$renditionCol.Add($rendition)
[Microsoft.SharePoint.Client.Publishing.SiteImageRenditions]::SetRenditions($ctx,$renditionCol)
$ctx.ExecuteQuery()
}
var showDocs = function() {
var qGroups = Srch.ScriptApplicationManager.get_current().queryGroups;
$.each(qGroups, function() {
if (this.displays != null && this.displays.length > 0) {
// Result source GUID
this.dataProvider.set_sourceID('70949b02-0f2c-4026-9c4f-c9d6e0023aa4');
this.dataProvider.issueQuery();
}
});
};
@rjesh-git
rjesh-git / git.migrate
Created September 13, 2016 17:14 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
=LEFT(RIGHT([URLCOLUMN],LEN([URLCOLUMN])-INT(FIND("DefaultView=",[URLCOLUMN])+11)),INT(FIND("&",RIGHT([URLCOLUMN],LEN([URLCOLUMN])-INT(FIND("DefaultView=",[URLCOLUMN])+11))))-1)
export interface IQuoteState {
error?: string;
quoteItems?: IQuoteItem[];
}
export default class Quotes extends React.Component<IQuoteProps, IQuoteState> {
constructor(props) {
super(props);
this.state = {
error: null,
censusItems: []
};
}
}
@rjesh-git
rjesh-git / GetAllGroups.ps1
Last active November 8, 2017 20:59
Get all Office 365 groups in tenant
$scopes = @("Group.Read.All")
Connect-PnPMicrosoftGraph -Scopes $scopes
Get-PnPUnifiedGroup
@rjesh-git
rjesh-git / addSCACommSites.ps1
Last active February 2, 2018 22:02
add site collection admin to communication sites
# Update the tenant url
PS C:\> .\Add-CommSitesSCA.ps1 -Url https://<tenant>-admin.sharepoint.com
## Or Provide optional credentials
PS C:\> $creds = Get-Credential
PS C:\> .\Add-CommSitesSCA.ps1-Url https://<tenant>-admin.sharepoint.com -Credentials $creds
// This is how you can access the page context info
this.context.pageContext.legacyPageContext;
// Retreive current user display name
this.context.pageContext.legacyPageContext['userDisplayName']);
// Even site classification
this.context.pageContext.legacyPageContext['siteClassification']);