Skip to content

Instantly share code, notes, and snippets.

View Cdaprod's full-sized avatar
🫠
Learn something new everyday!

David Cdaprod

🫠
Learn something new everyday!
View GitHub Profile
@Cdaprod
Cdaprod / AI_Tagging_and_Sorting_Tool.ipynb
Last active April 9, 2023 13:05
Notebook with AI functionality that tags and sorts…
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Cdaprod
Cdaprod / Shellfish-Snippets-to-VSCode-Snippets-Converter
Created July 5, 2023 16:42
This is for using shellfish iOS snippets on VS code using the user snippets.json file.
#!/usr/bin/env python3
import json
# Load shellfish-snippets.json
with open("shellfish-snippets.json", "r") as shellfish_file:
shellfish_snippets = json.load(shellfish_file)
# Convert to vscode-snippets.json format
vscode_snippets = {}
@Cdaprod
Cdaprod / test_input_field_using_selenium_for_xss-testing.js
Last active July 5, 2023 20:17
Snippet for testing input field against list of xss vars
// Assuming you have Selenium WebDriver and ChromeDriver installed
const {Builder, By, Key, until} = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
// list of XSS payloads to test
const xssPayloads = [
"<img src='x' onerror='alert(1);'>",
"<script>alert('XSS')</script>",
// Add more payloads as per your requirements
];
@Cdaprod
Cdaprod / test_template_injection_on_input_field_using_selenium.js
Last active July 5, 2023 20:16
For testing template injection on a page
const { Builder, By, Key, until } = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
const templateInjectionPayloads = [
'{{7*7}}', // Basic expression evaluation. Should return 49 if template injection is possible
'${7*7}', // This is for template engines that use $ like in AngularJS
'<%= 7 * 7 %>', // This is for EJS style templates
// Add more payloads to test different template engines
];
@Cdaprod
Cdaprod / DriveClean.ps1
Created July 6, 2023 18:19 — forked from mark05e/DriveClean.ps1
Simple script to clear temp files and browser cache/history
#------------------------------------------------------------------#
#- Clear-GlobalWindowsCache #
#------------------------------------------------------------------#
Function Clear-GlobalWindowsCache {
Remove-CacheFiles 'C:\Windows\Temp'
Remove-CacheFiles "C:\`$Recycle.Bin"
Remove-CacheFiles "C:\Windows\Prefetch"
C:\Windows\System32\rundll32.exe InetCpl.cpl, ClearMyTracksByProcess 255
C:\Windows\System32\rundll32.exe InetCpl.cpl, ClearMyTracksByProcess 4351
}
@Cdaprod
Cdaprod / ghcr.md
Created July 11, 2023 15:46 — forked from yokawasa/ghcr.md
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Cdaprod
Cdaprod / Dataloader and Conversational Chain.ipynb
Created July 19, 2023 18:22
Langchain scripts for Dataloader and ConversationalChain
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Cdaprod
Cdaprod / Notion to Langchain.ipynb
Last active July 19, 2023 18:26
Langchain scripts to pull Notion data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Cdaprod
Cdaprod / registration_automation_api_updated.py
Last active July 22, 2023 05:42
Automating account registration using selenium, run as a Flask API or as a command line script
#!/usr/bin/env python3
# /registration_automation_api_updated.py
from flask import Flask, request
from flask_restful import Api, Resource
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException