Skip to content

Instantly share code, notes, and snippets.

View huzefamehidpurwala's full-sized avatar
🎯
Focusing

Huzefa Mehidpurwala huzefamehidpurwala

🎯
Focusing
View GitHub Profile
@huzefamehidpurwala
huzefamehidpurwala / styles.css
Created May 31, 2024 11:25
img alt html/css
/* https://stackoverflow.com/questions/22051573/how-to-hide-image-broken-icon-using-only-css-html */
.image {
position: relative;
// height: 70px;
width: 70px;
img {
border-radius: 50%;
height: 70px;
@huzefamehidpurwala
huzefamehidpurwala / GraphConsumer.ts
Created May 27, 2024 05:41
Graph User Properties
/* eslint-disable */
// npm install @microsoft/microsoft-graph-types --save-dev
import { MSGraphClientV3 } from "@microsoft/sp-http";
import { escape } from "@microsoft/sp-lodash-subset";
import { WebPartContext } from "@microsoft/sp-webpart-base";
// businessPhones,directReports,displayName,givenName,id,imageUrl,jobTitle,mail,manager,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName,department,ageGroup,city,companyName,country,employeeType,faxNumber,employeeHireDate,userType
export const graphUserProps = [
@huzefamehidpurwala
huzefamehidpurwala / utils.ts
Created May 27, 2024 05:39
helpful typescript functions.
/* eslint-disable */
export function toTitleCase(str: string): string {
// Convert underscores, hyphens, and camelCase to spaces
str = str
.replace(/_/g, " ")
.replace(/-/g, " ")
.replace(/([a-z])([A-Z])/g, "$1 $2");
// Add a space before a capital letter if it's preceded by a lowercase letter
{
"rulesDirectory": [
"tslint-microsoft-contrib"
],
"rules": {
"class-name": false,
"export-name": false,
"forin": false,
"label-position": false,
"member-access": true,
@huzefamehidpurwala
huzefamehidpurwala / crud.ts
Last active March 22, 2024 06:47
crud operations on sharepoint list.
/* eslint-disable */
export const customIsEmpty = (val: any): boolean =>
val === "" ||
val === null ||
// val === "null" ||
// val === "undefined" ||
val === undefined ||
(typeof val === "object" && !Object.keys(val).length);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BollywoodGame
{
internal class Program
{
from string import whitespace, punctuation, digits, ascii_lowercase as letters
# from enchant import Dict
from requests import get
dic1 = dict()
dic2 = dict()
for i, l in enumerate(letters):
dic1.update({l.lower(): i})
dic1.update({i: l.upper()})
dic2.update({l.upper(): i})
@huzefamehidpurwala
huzefamehidpurwala / amzn-keywords.py
Created January 22, 2023 05:22
This python script takes a string of all related kewords and returns a non repeating keyword string to clipboard.
from os import system
system("cls")
flag = True
while flag:
string = input("Enter the words: ").split()
system("cls")
if not string:
@huzefamehidpurwala
huzefamehidpurwala / amzn-coupon.py
Created January 22, 2023 04:49
This python script works as a robot which takes 'product asins' stored in a text file in the same directory with the name 'asins.txt' and enters and select the specified product for coupon activation on Amazon SellerCenter.
import pyautogui
import time
with open("asin.txt", "r") as asins:
time.sleep(3)
for line in asins.readlines():
pyautogui.typewrite(line)
@huzefamehidpurwala
huzefamehidpurwala / excel-xlsx-handling.py
Created January 16, 2023 09:38
Create and append data to a xlsx file using openpyxl module.
from time import sleep
import openpyxl
from datetime import datetime
print("Welcome!\nWe are working...!")
# Get the current date and time
now = datetime.now()
worksheet_title = now.strftime("%Y-%m-%d") # for time %H-%M-%S