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
// https://nodejs.org/api/util.html#util_util_format_format_args | |
// util.format() is a synchronous method that is intended as a debugging tool. | |
// Some input values can have a significant performance overhead that can block | |
// the event loop. Use this function with care and never in a hot code path. | |
const { format } = require("util"); | |
function log(...args) { | |
// Note the subtle difference in the output. The %j is converted to JSON. | |
const msg = format("%j %s %s %s", ...args); |
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
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path | |
Push-Location $scriptDir | |
Add-Type -Path "$scriptDir\dll\log4net.dll" | |
$FileAppender = New-Object log4net.Appender.FileAppender( | |
( | |
[log4net.Layout.ILayout](New-Object log4net.Layout.PatternLayout('%date{yyyy-MM-dd HH:mm:ss.fff} | %level | %property{correlationId} | [%thread] | Department | App_Name | %c | $property{jobId} | %message%n')), | |
"$scriptDir\LogOutputInConsoleAndFile.log", # $LogFileName |
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
$i = 0 | |
while($true) { | |
$password = ConvertTo-SecureString "admin" -AsPlainText -Force | |
$cred = New-Object System.Management.Automation.PSCredential "admin", $password | |
$i++ | |
$body = "test$i" | |
Invoke-RestMethod -Uri "http://activemq:8161/api/message/mqttsignal?type=topic" -Method Post -ContentType "text/plain" -Credential $cred -Body $body |
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
/*! | |
* Created by Matthew Bramer | |
* Released under the MIT license | |
* Date: 2015-04-18 | |
* Props to: http://plumsail.com/blog/2015/02/start-sharepoint-2013-workflows-selected-items/ | |
* Tested using SharePoint Online. | |
* On-Prem still needs testing. | |
*/ | |
window.$sp = window.$sp || {}; |
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
$spd = Get-Process | ? {$_.ProcessName -eq 'SPDESIGN'} | |
$spdPath = ${env:ProgramFiles(x86)} + '\Microsoft Office\Office15\SPDESIGN.EXE' | |
if ($spd -ne $null) { | |
$spdPath = if ($spd.Path) { $spd.Path } # Else { ${env:ProgramFiles(x86)} + '\Microsoft Office\Office15\SPDESIGN.EXE' } | |
$spd.Kill(); | |
while(!$spd.HasExited) { | |
Start-Sleep 1000 | |
} |
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() { | |
// Is MDS enabled? | |
if ("undefined" != typeof g_MinimalDownload && g_MinimalDownload && (window.location.pathname.toLowerCase()).endsWith("/_layouts/15/start.aspx") && "undefined" != typeof asyncDeltaManager) { | |
// Register script for MDS if possible | |
RegisterModuleInit("init.js", init); //MDS registration | |
init(); //non MDS run | |
} else { | |
init(); | |
} |
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
$pathToOU = 'OU=SP Accounts,DC=fahq,DC=local' | |
$password = ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force | |
New-ADUser -SamAccountName "sp_wf" -Name "sp_wf" -DisplayName "sp_wf" -Path $pathToOU -Enabled $true -AccountPassword $password -ChangePasswordAtLogon $false -PasswordNeverExpires $true |
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
Write-Host ((0..56)|%{if (($_+1)%3 -eq 0){[char][int]("114101109121109097122097064103109097105108046099111109"[($_-2)..$_] -join "")}}) -separator "" |
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
javascript:(function(a){a.location.href=("undefined"!=typeof _spPageContextInfo?_spPageContextInfo.webAbsoluteUrl:a.location.origin+L_Menu_BaseUrl)+"/_layouts/closeConnection.aspx?loginasanotheruser=true"}(window)); |
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
$.fn.SPServices.StartWorkflow = function(options) { | |
var opt = $.extend({}, { | |
itemUrl: null, | |
workflowName: null, | |
workflowParameters: "<root />", | |
completefunc: null, // Function to call on completion of rendering the change. | |
debug: false // If true, show error messages;if false, run silent | |
}, options), | |
thisFunction = "SPServices.StartWorkflow", |