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 :: @iOnline247 | |
* Released under the MIT license | |
* Date: 2016-02-12 v1 | |
* Inspired from script written on: 2014-05-17 | |
* https://dl.dropboxusercontent.com/u/21583725/demos/SPSDC-ModalMania/demo/js/iframeDemo.js | |
* Tested using SharePoint Online. | |
* | |
* Helpful Links | |
* https://msdn.microsoft.com/en-us/library/office/dn531432.aspx#bk_UserCustomActionRequestExamples |
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( | |
[ValidateSet("DEV","TEST","PROD")] | |
[parameter(mandatory=$true)] | |
[string]$Environment = ("DEV","TEST","PROD") | |
) | |
# TODO | |
# Update with newer code patterns | |
$path = Split-Path -Path $MyInvocation.MyCommand.Path | |
$scriptName = [System.IO.Path]::GetFileNameWithoutExtension($MyInvocation.MyCommand.Source) |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"background": "#00c7fc", | |
"foreground": "#000000", | |
"style": "diamond", |
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
async function* iteratorGen(arr) { | |
for (const i of arr) { | |
if (typeof i === "function") { | |
yield i(); | |
} else { | |
yield i; | |
} | |
} | |
} |
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
/* | |
* Helpful JS utils & example usage. | |
*/ | |
const prop = (k) => (o) => o[k]; | |
const props = (ks) => (o) => ks.map((k) => o[k]); | |
const map = (f) => (a) => a.map(f); | |
const filter = (f) => (a) => a.filter(f); | |
const split = (delim) => (s) => { | |
s = String(s); | |
return s.split(delim); |
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://stackoverflow.com/a/22558858 | |
Get-ChildItem -Include *.js, *.css, *.html -Recurse | ForEach-Object { | |
$_ | Select-Object FullName, @{n = "Lines"; e = { Get-Content $_ | Measure-Object -Line | Select-Object -ExpandProperty Lines}}} |
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 getQueryStrings(v) { | |
const result = {}; | |
const rstripLeadingQuery = /^(:?\?|#)/; | |
const queryString = (v ? String(v) : window.location.search).replace( | |
rstripLeadingQuery, | |
'' | |
); | |
const re = /([^&=]+)=([^&]*)/g; | |
let m; |
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: 2016-08-05 | |
* Tested using SharePoint Online. | |
*/ | |
// Get $sp.min.js from here. | |
// https://gist.github.com/iOnline247/cc8d68cb611b056695434224e6c2aa19 | |
import '../vendor/$sp.min'; |
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: 2016-07-11 | |
* Props to: http://blogs.msmvps.com/windsor/2015/02/13/reduce-code-need-for-rest-api-calls-with-sprestrepository/ | |
* Tested using SharePoint Online & 2013 On-Prem. | |
*/ | |
// http://sharepoint.stackexchange.com/questions/74978/can-i-tell-what-version-of-sharepoint-is-being-used-from-javascript |
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 logMsg($text, $color = [System.ConsoleColor]::green) { | |
Write-Host $text -foregroundcolor $color | |
Write-Host "`r`n" | |
} | |
<# | |
function Remove-DirectoryPathInfo ($fileInfo) { | |
$fileInfo.Path = $fileInfo.Path -replace "$([Regex]::Escape($testFiles[0].Parent.Parent.FullName))\\", "" | |
$fileInfo.Path = $fileInfo.Path -replace "$([Regex]::Escape($initialFiles[0].Parent.Parent.FullName))\\", "" | |
# "$([Regex]::Escape($parentDirectoryPath))\\" |
NewerOlder