This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
@echo Stopping Sharepoint services... | |
@echo Restarting The SharePoint Timer Service... | |
net stop SPTimerV4 | |
net start SPTimerV4 | |
@echo Restarting The SharePoint Administration Service... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Condition statement": { | |
"prefix": "cond", | |
"body": [ | |
"${_} { ${0}; break }" | |
], | |
"description": "Switch condition statement" | |
}, | |
"Condition single quoted string statement": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"globals" : | |
{ | |
"alwaysShowTabs" : true, | |
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", | |
"initialCols" : 120, | |
"initialRows" : 30, | |
"keybindings" : | |
[ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$username = "" | |
$password = "" | |
$Password = ConvertTo-SecureString -String $password -AsPlainText -Force; | |
$Credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password | |
Connect-SPOService -Url "https://[tenant]-admin.sharepoint.com" -Credential $Credentials | |
Get-SPODeletedSite | Remove-SPODeletedSite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################### | |
# PREREQUISITES | |
##################### | |
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Set-TaskbarSmall | |
# Console | |
cinst PowerShell | |
cinst poshgit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server"> | |
<table style="width: 100%"> | |
<tr valign="top"> | |
<td width="20%"> | |
<SharePoint:SPHierarchyDataSourceControl ID="docLibDataSource" runat="server" RootContextObject="List" ShowFolderChildren="True" EnableViewState="false"></SharePoint:SPHierarchyDataSourceControl> | |
<SharePoint:SPTreeView ID="doclibtreeview" runat="server" DataSourceID="docLibDataSource" EnableViewState="false" ExpandDepth="2" SelectedNodeStyle-CssClass="ms-tvselected"></SharePoint:SPTreeView> | |
</td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GravatarHelper | |
{ | |
private string CalculateHash(string email) | |
{ | |
MD5 md5Hasher = MD5.Create(); | |
byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(email)); | |
StringBuilder sBuilder = new StringBuilder(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Route("api/[controller]")] | |
public class FilesController : ControllerBase | |
{ | |
[HttpGet] | |
public async Task<IActionResult> Download(string filename) | |
{ | |
if (filename == null) | |
return Content("filename not present"); | |
var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "download", filename); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Dictionary<string,string> Run(string connectionString, string query) | |
{ | |
using (var sqlConnection = new SqlConnection(connectionString)) | |
{ | |
sqlConnection.StatisticsEnabled = true; | |
sqlConnection.Open(); | |
using (var cmd = new SqlCommand(query, sqlConnection)) | |
{ |