Skip to content

Instantly share code, notes, and snippets.

View dsmabulage's full-sized avatar

Dileepa Sandaruwan Mabulage dsmabulage

View GitHub Profile
@dsmabulage
dsmabulage / DVWA_reCAPTCHA_Configuration.md
Last active May 10, 2025 00:24
DVWA (Damn Vulnerable Web Application) is an intentionally vulnerable PHP/MySQL application for testing web security tools and techniques. By default, the reCAPTCHA fields in the configuration file are left empty, which prevents certain features (e.g., CAPTCHA on login) from functioning correctly. This guide demonstrates how to fix that by integ…

Fixing reCAPTCHA Configuration in DVWA (Damn Vulnerable Web Application)

This guide walks you through resolving the reCAPTCHA vulnerability in DVWA by properly configuring the reCAPTCHA keys within a Dockerized environment.

🛠️ Description

DVWA (Damn Vulnerable Web Application) is an intentionally vulnerable PHP/MySQL application for testing web security tools and techniques. By default, the reCAPTCHA fields in the configuration file are left empty, which prevents certain features (e.g., CAPTCHA on login) from functioning correctly. This guide demonstrates how to fix that by integrating Google reCAPTCHA.


@dsmabulage
dsmabulage / app.js
Created September 25, 2023 15:27
Null Operators
console.log(null || 'default value'); // 'default value'
console.log(undefined || 'default value'); // 'default value'
console.log(false || 'default value'); // 'default value'
console.log('' || 'default value'); // 'default value'
console.log(0 || 'default value'); // 'default value'
console.log(NaN || 'default value'); // 'default value'
console.log('Hello' || 'default value'); // 'Hello'
console.log(null || 100); // 100
console.log(undefined || 100); // 100
@dsmabulage
dsmabulage / page.tsx
Created September 25, 2023 05:01
Query Param Search
'use client';
import { FC, useState, useEffect } from 'react';
import { useRouter, useSearchParams } from 'next/navigation';
import Link from 'next/link';
const colorVariants = [
{
name: 'black',
label: 'Black',
},
@dsmabulage
dsmabulage / page.tsx
Created September 25, 2023 04:56
Create useDebounce hook
const [value, setValue] = useState('');
const debouncedValue = useDebounce(value, 500);
const [users, setUsers] = useState<User[]>([]);
const searchUsers = async () => {
const res = await fetch('https://jsonplaceholder.typicode.com/users');
const data: User[] = await res.json();
const filteredData = data.filter((user) => {
return user.name.toLowerCase().includes(value.toLowerCase());
@dsmabulage
dsmabulage / app.js
Last active September 24, 2023 11:30
Delete Multiple GitHub workflows via APIs
// First generate a personal access token for your account
// https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
// For every APi request send the token as a bearer token
// HTTP GET
https://api.github.com/repos/{account_name}/{repo_name}/actions/workflows
// This will return all the workflows in the selected repository
// HTTP GET
https://api.github.com/repos/{account_name}/{repo_name}/actions/workflows/{workflow_id}/runs
@dsmabulage
dsmabulage / colour find.EXCEL.yaml
Created August 26, 2022 06:06
Create a new snippet from a blank template.
name: colour find
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@dsmabulage
dsmabulage / row count.EXCEL.yaml
Created August 26, 2022 05:26
Create a new snippet from a blank template.
name: row count
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@dsmabulage
dsmabulage / colour find.EXCEL.yaml
Created August 26, 2022 05:12
Create a new snippet from a blank template.
name: colour find
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@dsmabulage
dsmabulage / Blank snippet (3).EXCEL.yaml
Created August 25, 2022 08:20
Create a new snippet from a blank template.
name: Blank snippet (3)
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@dsmabulage
dsmabulage / Blank snippet (3).EXCEL.yaml
Created August 25, 2022 07:34
Create a new snippet from a blank template.
name: Blank snippet (3)
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {