Skip to content

Instantly share code, notes, and snippets.

View rasel-rz's full-sized avatar

Raihanuzzaman Rasel rasel-rz

View GitHub Profile
import os
import openpyxl
from pathlib import Path
dir_containing_files = os.getcwd() + '\\data'
# print(dir_containing_files)
# print(type(dir_containing_files))
dest_wb = openpyxl.Workbook()
collectables = []
for root, dir, filenames in os.walk(dir_containing_files):
var mainContentElem = document.getElementById('MainContent');
var indexOfRecentSlider = 0;
var recentlyViewedSection = document.createElement('div');
recentlyViewedSection.id = 'customRecentlyViewedSection';
recentlyViewedSection.classList.add('shopify-section');
recentlyViewedSection.classList.add('index-section');
var parentPageWidthDiv = document.createElement('div');
recentlyViewedSection.appendChild(parentPageWidthDiv);
@rasel-rz
rasel-rz / txt2csv.py
Created August 8, 2020 12:05
Usage: python txt2csv.py <TextFileName> <CSVFileName>
import csv
import sys
# print('x')
def main(inputFile, outputFile):
myFile = open(inputFile, "r")
with open(outputFile, 'w', newline='') as file:
writer = csv.writer(file)
writer.writerow(["Date", "Name", "IP", "Description"])
def camelCase(text):
textLength = len(text)
outText = ''
nextOneIsCapital = False
for i in range(textLength):
if i is 0:
outText = outText + text[i].lower()
else:
if text[i] is not ' ':
if nextOneIsCapital:
count = 0
for i in range(4):
# print(i)
jloop = i + 1
for j in range(jloop):
print(count, end="->")
count = count + 1
print("")
for i in range(10):
# Everything here executes ten time
print(i)
# This loop ends here because the next line doesn't have a TAB Space in front.
for i in range(15):
print(i)
#This loop ends here.
print("Jannat")
# Score starts with zero.
scores = [300, 500, 500, 0, 600]
lives = 3 # Default 3 lives
# Game state negative means means Start Menu
# Positive means Playing
gameState = 0
print("Playing")
for score in scores:
if lives is 0:
def minimumSwaps(arr):
arr = [x - 1 for x in arr]
i = 0
count = 0
while i < len(arr):
# print(i)
temp = arr[i]
if(i != arr[i]):
arr[i] = arr[temp]
arr[temp] = temp