I hereby claim:
- I am mashariqk on github.
- I am mashariqk (https://keybase.io/mashariqk) on keybase.
- I have a public key whose fingerprint is 06EB 5B8C E6F5 BFD5 5052 85AF CF94 1610 8819 168A
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
fileName = "CsvFile.csv" | |
indexNames = ["indexName1", "indexName2"] | |
for indexName in indexNames: | |
with open(fileName, "r") as sourceFile: | |
with open(indexName + ".impex", "a") as targetFile: | |
targetFile.write( | |
"INSERT SolrSynonymConfig;facetSearchConfig(name);language(isocode)[allownull=true];synonymFrom[allownull=true];synonymTo\n") | |
for line in sourceFile: | |
listOfFields = [x.strip() for x in line.split(",")] |
''' | |
This script can be used to clear cache of a hybris instance in an infinite loop | |
''' | |
import os | |
import time | |
#The token and jsessionid can be fetched when clearing cache from HAC and checking the request header | |
xcsrf = "23-24-234-234-23" | |
jsessionid = "234234234234234" |
fileName = '../200k/Customer_06052018_1700.csv' | |
destFileName = '../200k/Customer_06052018_1799.csv' | |
with open(fileName,"r") as sourceFile: | |
with open(destFileName, "a") as targetFile: | |
for line in sourceFile: | |
listOfFields = [x.strip() for x in line.split(",")] | |
replacementForUid = '"' + listOfFields[3].replace('"','') + '|fl"' | |
listOfFields[3] = replacementForUid |
''' | |
This script will be used to generate mock Customer files to be loaded in non-PROD environment as part of load testing | |
''' | |
# First we will declare the constants that will be required | |
___doubleQuote = '"' | |
___comma = ',' | |
INIT_SEED_VAL = '239480232' | |
RANDOM_SEED = int(INIT_SEED_VAL) |
''' | |
This script will take in one big file and split it into multiple files as controlled by the noOfFiles variable | |
''' | |
from itertools import (takewhile, repeat, islice) | |
fileName = 'mybigfile.txt' | |
noOfFiles = 5 | |
targetFilePrefix = 'sample_' | |
targetFileEnding = '.txt' |
import re | |
filePath = '/Users/u/filewithspecialcharacters.csv' | |
fileEncoding = 'iso-8859-1' | |
pattern = r"^[a-zA-Z0-9_;:!@?'.#(){}*|~/+%&<>,–`=\"\s\-\$\[\]\^\\]*$" | |
compiledPattern = re.compile(pattern) | |
count = 0 |
import xlrd | |
import pandas | |
df = pandas.read_excel('/path/to/Excel/File/ExcelFile.xlsx',sheet_name=0) | |
with open("excel.impex", "a") as impexFile: | |
impexFile.write("UPDATE CUSTOMER[batchmode=true];originalUid[unique=true];field1;field2(code);field3[dateformat=MMM dd yyyy hh:mm aa]") | |
for index, row in df.iterrows(): | |
if isinstance(row['excel_field3_name'],str): |
function returnParsedUrl() { | |
var url = request.url.trim(); | |
var firstArray = url.split('{{'); | |
var listOfProperties = [""]; | |
for (i = 1; i < firstArray.length; i++) { | |
listOfProperties[i - 1] = firstArray[i].substring(0, firstArray[i].indexOf("}}")); | |
} | |
var completeUrl = ""; | |
for (i = 0; i < firstArray.length; i++) { | |
if (firstArray[i].includes("}}")) { |
import java.io.*; | |
import java.util.Map; | |
import java.util.Vector; | |
import java.util.HashMap; | |
import java.util.StringTokenizer; | |
import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
import org.apache.poi.hssf.usermodel.HSSFSheet; | |
import org.apache.poi.hssf.usermodel.HSSFRow; | |
import org.apache.poi.hssf.usermodel.HSSFCell; | |
import org.apache.poi.hssf.usermodel.HSSFCellStyle; |