Skip to content

Instantly share code, notes, and snippets.

View ArchTaqi's full-sized avatar
🏠
Working from home

Muhammad Taqi ArchTaqi

🏠
Working from home
View GitHub Profile
@ArchTaqi
ArchTaqi / keybase.md
Created May 22, 2025 10:07
keybase.md

Keybase proof

I hereby claim:

  • I am archtaqi on github.
  • I am archtaqi (https://keybase.io/archtaqi) on keybase.
  • I have a public key ASBwJMzs-zmtEWu1UtXE27xXBzk9mILNnZB_vGxNFbpNeAo

To claim this, I am signing this object:

@ArchTaqi
ArchTaqi / factoryPattern.md
Last active February 12, 2025 11:17
PHP Interview Questions

Implementing a Factory Pattern for Vacation Management in PHP

We are building a vacation management system where different types of vacations (Paid Vacation, Sick Leave, and Work From Home) need to be created dynamically based on user input.

Demo Code (Starter):

Below is an incomplete PHP code snippet. Your task is to complete the VacationFactory class so that it properly creates instances of different vacation types using the Factory Pattern.

Use any online compiler to write code;

@ArchTaqi
ArchTaqi / calc.php
Last active September 7, 2024 11:52
QueryBuilder PHP
<?php
// Usage example:
$calculator = new Calculator();
$result = $calculator->setValue(5)->add(3)->multiply(2)->getResult();
?>
@ArchTaqi
ArchTaqi / dry.php
Created September 7, 2024 11:49
DRY PHP
<?php
function showDeveloperList(array $developers): void
{
foreach ($developers as $developer) {
$expectedSalary = $developer->calculateExpectedSalary();
$experience = $developer->getExperience();
$githubLink = $developer->getGithubLink();
$data = [$expectedSalary, $experience, $githubLink];

Building your own crypto-currency using Solana

  1. Set up a wallet
  2. Mint (create) your own token
  3. Make your own NFT

1 - Setting Up a Solana Wallet (keypair)

@ArchTaqi
ArchTaqi / Question2.md
Created March 27, 2022 21:20
Codora Internship Program Assessment

If an Algorithm contains 3 loops inside, with time complexities O(n), O(n2) and O(n). What will be the the total time complexity?

for (int i = 1; i <= n; i++)  {
// code   
}    

for (int i = 1; i <= n; i++) {        
 for (int j = 1; j &lt;= n; j++) { 
@ArchTaqi
ArchTaqi / LambdaLayers.md
Created July 22, 2021 14:32
How to Install Python Packages for AWS Lambda Layers

A guide on how to build Python Packages for AWS Lambda Layers using Docker containers.

Limitations of Lambda Layers

There are a few limitations that you need to be aware of and this includes:

  • You can only use up to 5 layers per Lambda.
  • The size of all your layers unzipped cannot exceed 250mb.
  • Layers are mounted to the /opt directory in the function’s execution environment so be sure to Layer your functions properly if you are going to have more than one.
for region in `aws ec2 describe-regions --query 'Regions[].RegionName' --output text`; do
aws sns list-subscriptions --query "Subscriptions[?starts_with(Endpoint, 'arn:aws:sqs:')].[TopicArn, Endpoint]" --output text --region $region
done
@ArchTaqi
ArchTaqi / mysqlbackupforcrashplan.bash
Created June 9, 2021 19:35 — forked from gene1wood/mysqlbackupforcrashplan.bash
Script that exports a MySQL database so it can be backed up
#!/bin/bash
#
# A script to create a daily mysqldump for crashplan
# Defaults
# Override them in /etc/default/mysqlbackupforcrashplan
OUTPUTFILE=/var/local/full-backup.sql
STATEFILE=/var/local/full-backup.sql.state
CRONFILE=/etc/cron.d/mysqlbackupforcrashplan
MYSQLDUMPBIN=/usr/bin/mysqldump
@ArchTaqi
ArchTaqi / delete_all_s3_bucket_files
Created June 9, 2021 19:34 — forked from gene1wood/delete_all_s3_bucket_files
Command to delete all objects from S3 bucket using lifecycle configuration
for bucket in `cat list-of-s3-buckets.txt`; do
aws s3api put-bucket-lifecycle \
--bucket $bucket \
--lifecycle-configuration '{"Rules":[{"ID":"cleanup","Status":"Enabled","Prefix":"","Expiration":{"Days":1}}]}';
done