Skip to content

Instantly share code, notes, and snippets.

View Credit card mask
<TextField
id="creditCardNumber"
label="Credit Card Number"
name="card_number"
placeholder="xxxx xxxx xxxx xxxx"
value={card_number}
onChange={handleChange}
InputProps={{
inputComponent: InputMaskingCreditCard,
}}
@jeevan90
jeevan90 / keys.js
Created May 26, 2020
JS Keys Mapping
View keys.js
var Keys = {
backspace: 8,
tab: 9,
enter: 13,
shift: 16,
esc: 27,
space: 32,
pageUp: 33,
pageDown: 34,
end: 35,
@jeevan90
jeevan90 / guid.js
Created May 26, 2020
Generate GUID jn JS
View guid.js
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);
View read-write-xml.ps1
$xmlFileName "Path to XML File";
[xml]$xmlDoc = Get-Content $xmlFileName
$xmlDoc.App.Secret = "Some Value"
$xmlDoc.Save($xmlFileName)
View read-write-xml.ps1
$xmlFileName "Path to XML File";
[xml]$xmlDoc = Get-Content $xmlFileName
$xmlDoc.APP.Secret = "Some Value"
$xmlDoc.Save($xmlFileName)
View sample.xml
<App>
<Secret></Secret>
</App>
@jeevan90
jeevan90 / xdttransform.ps1
Created Nov 29, 2019
xdt transform script
View xdttransform.ps1
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
@jeevan90
jeevan90 / msdeploy.cmd
Created Nov 29, 2019
msdeploy cmd to install Sitecore Azure Blob Storage module on an on-premise Sitecore instance
View msdeploy.cmd
"<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
@jeevan90
jeevan90 / composing-software.md
Created Oct 12, 2019 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
View using-using.ps1
# $Connection object will be diposed.
Using-Object($Connection = New-Object System.Data.SQLClient.SQLConnection($ConnectionString)) {
#code goes here.
}