Skip to content

Instantly share code, notes, and snippets.

View vaibhavpandeyvpz's full-sized avatar
🐢
I may be slow to respond.

Vaibhav Pandey vaibhavpandeyvpz

🐢
I may be slow to respond.
View GitHub Profile
@chigkim
chigkim / codex.txt
Created January 15, 2026 06:10
Codex System Prompt
You are a coding agent running in the Codex CLI, a terminal-based coding assistant. Codex CLI is an open source project led by OpenAI. You are expected to be precise, safe, and helpful.
Your capabilities:
- Receive user prompts and other context provided by the harness, such as files in the workspace.
- Communicate with the user by streaming thinking & responses, and by making & updating plans.
- Emit function calls to run terminal commands and apply patches. Depending on how this specific run is configured, you can request that these function calls be escalated to the user for approval before running. More on this in the \"Sandbox and approvals\" section.
Within this context, Codex refers to the open-source agentic coding interface (not the old Codex language model built by OpenAI).
@vaibhavpandeyvpz
vaibhavpandeyvpz / infosec-iq-qa.js
Last active July 31, 2025 17:09
Complete a InfoSec institute course automatically.
function getCsrfToken() {
var parts = ('; ' + document.cookie)
.split("; csrf=");
if (parts.length === 2) {
const value = parts.pop().split(";").shift();
return decodeURIComponent(value);
}
}
function sendXhr(url, method, data = null, headers = {}) {
@vaibhavpandeyvpz
vaibhavpandeyvpz / 00-common-aws-policies.md
Last active February 22, 2022 05:01
Common policies for AWS/IAM

This Gist includes some of the common AWS/IAM policy examples to give granular access to users.

@vaibhavpandeyvpz
vaibhavpandeyvpz / metabase.md
Last active December 1, 2021 20:05
Running Metabase + Nginx + SSL on Ubuntu

First get Docker installed and setup on machine. Once installed, create a new user e.g., metabase for your installation using following command:

sudo adduser metabase

Now add the newly created user to docker group, you won't need sudo for docker ... commands:

sudo usermod -aG docker metabase
@vaibhavpandeyvpz
vaibhavpandeyvpz / certificates.sh
Last active May 8, 2025 06:21
Generate SHA-256 hashes from SSL's chain of trust for a domain.
#!/bin/bash
CERTIFICATES=`openssl s_client -servername $1 -host $1 -port 443 -showcerts </dev/null 2>/dev/null | sed -n '/Certificate chain/,/Server certificate/p'`
CURSOR=$CERTIFICATES
while [[ "$CURSOR" =~ '-----BEGIN CERTIFICATE-----' ]]
do
CERTIFICATE="${CURSOR%%-----END CERTIFICATE-----*}-----END CERTIFICATE-----"
CURSOR=${CURSOR#*-----END CERTIFICATE-----}
echo `echo "$CERTIFICATE" | grep 's:' | sed 's/.*s:\(.*\)/\1/'`
@mirmilad
mirmilad / debounce.kt
Last active June 21, 2023 22:46
Simple debounce extension for LiveData by using Coroutines
import androidx.lifecycle.LiveData
import androidx.lifecycle.MediatorLiveData
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
fun <T> LiveData<T>.debounce(duration: Long = 1000L, coroutineScope: CoroutineScope) = MediatorLiveData<T>().also { mld ->
val source = this
@vaibhavpandeyvpz
vaibhavpandeyvpz / center-element.js
Last active November 8, 2019 03:09
Center an element horizontally and/or vertically using JavaScript.
function resize($el) {
const data = $el.data('center');
if (data.x) {
const w_width = $(window).width();
const e_width = $el.width();
const margin = (w_width - e_width) / 2;
$el.css('left', margin)
}
if (data.y) {
const w_height = $(window).height();
@vaibhavpandeyvpz
vaibhavpandeyvpz / Example.js
Last active January 7, 2022 23:45
Laravel, Axios & Logout Over AJAX
import React from 'react';
import ReactDOM from 'react-dom';
const handleLogout = () => {
axios.post('/logout')
.then(() => location.href = '/home')
};
function Example() {
return (
@vaibhavpandeyvpz
vaibhavpandeyvpz / escape.js
Created May 15, 2019 03:53
Escape HTML tags in JS before rendering to DOM.
const e = str => {
const replacements = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
"'": '&#039;',
'"': '&quot;',
};
return str.replace(/[&<>"']/g, match => replacements[match])
};
@vaibhavpandeyvpz
vaibhavpandeyvpz / ActiveExtension.php
Created May 15, 2019 03:48
Twig extension for rendering 'active' class depending on path or route.
<?php
namespace App\Twig;
use Symfony\Component\HttpFoundation\RequestStack;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
class ActiveExtension extends AbstractExtension
{