Skip to content

Instantly share code, notes, and snippets.

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