A collection of links to the excellent"Composing Software" series of medium stories by Eric Elliott.
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
<TextField | |
id="creditCardNumber" | |
label="Credit Card Number" | |
name="card_number" | |
placeholder="xxxx xxxx xxxx xxxx" | |
value={card_number} | |
onChange={handleChange} | |
InputProps={{ | |
inputComponent: InputMaskingCreditCard, | |
}} |
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 Keys = { | |
backspace: 8, | |
tab: 9, | |
enter: 13, | |
shift: 16, | |
esc: 27, | |
space: 32, | |
pageUp: 33, | |
pageDown: 34, | |
end: 35, |
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 guid = function () { | |
var id = ''; | |
var i; | |
var random; | |
for (i = 0; i < 32; i++) { | |
random = Math.random() * 16 | 0; | |
if (i === 8 || i === 12 || i === 16 || i === 20) { | |
id += '-'; | |
} | |
id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16); |
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
$xmlFileName "Path to XML File"; | |
[xml]$xmlDoc = Get-Content $xmlFileName | |
$xmlDoc.App.Secret = "Some Value" | |
$xmlDoc.Save($xmlFileName) |
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
$xmlFileName "Path to XML File"; | |
[xml]$xmlDoc = Get-Content $xmlFileName | |
$xmlDoc.APP.Secret = "Some Value" | |
$xmlDoc.Save($xmlFileName) |
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
<App> | |
<Secret></Secret> | |
</App> |
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 XmlDocTransform($xml, $xdt) | |
{ | |
if (!$xml -or !(Test-Path -path $xml -PathType Leaf)) { | |
throw "File not found. $xml"; | |
} | |
if (!$xdt -or !(Test-Path -path $xdt -PathType Leaf)) { | |
throw "File not found. $xdt"; | |
} | |
$scriptPath = (Get-Variable MyInvocation -Scope 1).Value.InvocationName | split-path -parent |
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
"<FolderPathOfMsDeploy>\msdeploy.exe" -verb:sync -source:package="<FilePathOfWDP>" -dest:auto="<RootUrlOfSitecoreInstance>" -setParam:"IIS Web Application Name"="<IISWebAppName>" -setParam:"AzureStorageConnectionString"="<AzureStorageConnectionString>" -setParam:"AzureStorageContainerName"="<AzureStorageBlobContainerName>" -setParam:"DefaultProvider"="azure" -enableRule:DoNotDeleteRule -verbose |
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
private bool CompareStreams(Stream a, Stream b) | |
{ | |
if (a == null && | |
b == null) | |
return true; | |
if (a == null || | |
b == null) | |
{ | |
throw new ArgumentNullException( | |
a == null ? "a" : "b"); |
NewerOlder