Study material organized by topic
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
function Prompt | |
{ | |
# Admin ? | |
if( ( | |
New-Object Security.Principal.WindowsPrincipal ( | |
[Security.Principal.WindowsIdentity]::GetCurrent()) | |
).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) | |
{ | |
# Admin-mark in WindowTitle | |
$Host.UI.RawUI.WindowTitle = "[Admin] " + $Host.UI.RawUI.WindowTitlep |
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
#Adds the PowerShell Deployment snapin. | |
add-pssnapin SourceCode.Deployment.PowerShell | |
#Scripts the deployment of a package | |
Deploy-Package $(System.DefaultWorkingDirectory)/K2-CI-Demo-CI/$(Build.BuildNumber)/ExpenseClaim.kspx $(System.DefaultWorkingDirectory)/K2-CI-Demo-CI/$(Build.BuildNumber)/ExpenseClaim.xml |
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
//Converting the 'text' into '{text}' for the Email Templating placeholders | |
var dragListBox = function(ev) { | |
ev.dataTransfer.setData("text",'{' + ev.srcElement.text + '}'); | |
}; | |
//Adding html attributes to make the inner items draggable | |
$('div[name="NameOfYourListBox"]') | |
.find('.optionwrapper') | |
.find('.option') | |
.attr('draggable', 'true') | |
.attr('ondragstart', 'dragListBox(event)'); |
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
param([string]$appName, [string]$categoryPath) | |
if(-not($appName)){ Throw "You must provide the name for your application"} | |
if(-not($categoryPath)){ Throw "You must provide the path for your application category"} | |
#01. Create a folder for the output | |
New-Item -ItemType Directory -Force -Path $PSScriptRoot\PND | |
#02. Create a package | |
Import-Module $PSScriptRoot\Assemblies\K2Field.Powershell.Module.dll -Verbose -Force |
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
<!--Insert the snippet below in a Literal Datalabel --> | |
<style type="text/css"> | |
div[name="View Name"] .grid-body tbody td:nth-child(%ColumnNumber%) { | |
background: #FFFACD !important | |
} | |
</style> | |
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
using DocumentFormat.OpenXml.Packaging; | |
using DocumentFormat.OpenXml.Spreadsheet; | |
public static string GetCellValue(string fileName, string sheetName, string addressName) | |
{ | |
string value = null; | |
using (SpreadsheetDocument document = SpreadsheetDocument.Open(fileName, false)) | |
{ | |
WorkbookPart wbPart = document.WorkbookPart; | |
Sheet theSheet = wbPart.Workbook.Descendants<Sheet>().Where(s => s.Name == sheetName).FirstOrDefault(); |
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
<!-- Checked --> | |
<label class="input-control checkbox checked" data-defaultvalue="false"> | |
<span class="input-control-img"></span> | |
</label> | |
<!-- Not checked --> | |
<label class="input-control checkbox" data-defaultvalue="false"> | |
<span class="input-control-img"></span> | |
</label> |
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 static class AdQueryHelper | |
{ | |
public static List<AdObject> GetComputers(string ldapPath, int sizeLimit, int pageSize) | |
{ | |
List<AdObject> adEntries = new List<AdObject>(); | |
using (DirectoryEntry entry = new DirectoryEntry(ldapPath)) | |
{ | |
using (DirectorySearcher mySearcher = new DirectorySearcher(entry)) | |
{ | |
mySearcher.Filter = ("(objectClass=computer)"); |
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
var headerClick = function(self) { | |
if(self){ | |
$(self.currentTarget).find('a').click(); | |
} | |
}; | |
$('.grid-header').click(headerClick); |
NewerOlder