Skip to content

Instantly share code, notes, and snippets.

View JoeAlanis's full-sized avatar

Joe Alanis [MSFT] JoeAlanis

View GitHub Profile
<style>
.ms-acal-sdiv .ms-acal-time
{
display: none;
}
</style>
<script type="text/javascript" src="_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="_layouts/15/sp.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"></script>
<script>
var context;
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', GetCustomActions);
function GetCustomActions()
{
$(.s4-itm-cbx.s4-itm-imgCbx[aria-checked="true"])
if (window.location.href.indexOf('viewlsts.aspx') > -1) {
$("#createnewsite").parent().hide();
return;
}
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js"></script>
<iframe id="iframe" src="" width="800px" height="400px"></iframe>
<script type="text/javascript">
$(document).ready(function() {
$('#iframe').attr('src','http://adatumsqlbi/reports/powerbi/PowerBITest?rs:Embed=true');
});
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$(".ms-acal-sdiv >a, .ms-acal-title").text(function () {
return $(this).text().replace("No Title", "");
});
});
@JoeAlanis
JoeAlanis / Disable-InfoPathFormEditButton.js
Last active November 3, 2018 17:42
Javascript code to hide the edit buttons in an InfoPath Form that has specific text
//Hide the Edit function inside an infopath form if it has an H1 with "End User View" text
if(($("h1:contains('End User View')").length) != 0)
{
console.log('Hiding edit buttons.');
$("#Ribbon\\.Tabs\\.InfoPathListDisplayTab\\.Manage").css('display','none');
}
Add-PSSnapin Microsoft.SharePoint.PowerShell
Workflow Visit-Sites
{
[cmdletbinding()]
param([object]$sites)
$results =@()
foreach -parallel($s in $sites)
{
$row = inlinescript{
## Check if the Application Initialization feature is installed, if not install it
$webAppInit = Get-WindowsFeature -Name "Web-AppInit"
Write-output "$($webAppInit.Name) installed: $($webAppInit.Installed)"
if(!$webAppInit.Installed)
{
Write-output "Installing: $($webAppInit.Name)"
Install-WindowsFeature $webAppInit -ErrorAction Stop
}
USE tempdb;
GO
DBCC SHRINKFILE('tempdb4', EMPTYFILE)
GO
USE master;
GO
ALTER DATABASE tempdb
REMOVE FILE tempdb4;