Skip to content

Instantly share code, notes, and snippets.

View neel1996's full-sized avatar
πŸŒ€
Compiling βŒ› Building βš’ Build failed unexpectedly πŸ“› Rebuild & Repeat πŸ”

Neel neel1996

πŸŒ€
Compiling βŒ› Building βš’ Build failed unexpectedly πŸ“› Rebuild & Repeat πŸ”
View GitHub Profile
@neel1996
neel1996 / automateCTValidationFix.js
Last active August 27, 2025 02:59
ClearTax CG Validation Fixer
// Inspect the DOM and save the parent tbody element as a global variable temp1
async function automate() {
for (const item of temp1.childNodes) {
if (item.classList.contains("_X-XXXX")) { // replace with the class name of the <td> entry with validation error
const edit = item.getElementsByClassName("pointer")[0];
const clickEvent = new Event("click", { bubbles: true });
edit.dispatchEvent(clickEvent);
await sleep(1000);
@neel1996
neel1996 / cf_demo_env.md
Created January 21, 2024 04:39
Env CF demo
Variable What is it?
CLOUDFRONT_DOMAIN The domain of the created distribution
CLOUDFRONT_PUBLIC_KEY_ID The unique ID of the public key. This can be found under the "Public Keys" section in the CloudFront sidebar

e.g. K1X0XXXXXXXXXX
SECRET_ID The name of the secret that holds the private key.In this article, I have set it as "clodufront/privatekey"
@neel1996
neel1996 / cf_fields.md
Created January 21, 2024 04:36
CF Fields
Fields Purpose
Origin domain The source of your content and this input field will display all the available S3 buckets from your account. You can select the bucket from where you wish to serve the content
Origin Access The access boundary for the S3 bucket

Public - Provided the bucket has public access, this option will allow anyone to access the objects from the bucket using the generated CloudFront URL (e.g. https://custom.cloudfront.com/image.png)

Origin access control settings - This is the recommended access level and we will use this to create a new control setting that enables only signed URLs to access the content
Restrict viewer access This will control the viewing access of the content from the bucketNo - Anyone can download/view the content using the custom CloudFront URL (e.g. https://custom.cloudfront.com/image.png)**Yes** - The objects will be accessible only using a signed URL (or a signe
@neel1996
neel1996 / Signer.java
Created January 19, 2024 18:14
Java lambda function to generate a signed CloudFront URL
/*
* Runtime: Java 17
* Required Gradle Dependencies:
*
*
dependencies {
implementation 'com.amazonaws:aws-lambda-java-core:1.2.2'
implementation 'com.amazonaws:aws-java-sdk-cloudfront:1.12.638'
implementation 'software.amazon.awssdk:s3:2.23.0'
implementation 'software.amazon.awssdk:secretsmanager:2.20.109'
@neel1996
neel1996 / signer_lambda.py
Last active January 20, 2024 07:02
Function to create a CloudFront signed URL using a Trusted KeyGroup
"""
# The cryptography package needs to be bundled along with this script as a zip file
# Use the exact command from below to download the cryptography package
# The cryptography package relies on a shared object file which will not be available
# in the lambda runtime. Running this command ensures that it is added to the target directory
pip install \
--platform manylinux2014_x86_64 \
--implementation cp \