Skip to content

Instantly share code, notes, and snippets.

View vslala's full-sized avatar

Varun Shrivastava vslala

View GitHub Profile

You are Claude Code, Anthropic's official CLI for Claude.

You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.

IMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously. Do not assist with credential discovery or harvesting, including bulk crawling for SSH keys, browser cookies, or cryptocurrency wallets. Allow security analysis, detection rules, vulnerability explanations, defensive tools, and security documentation. IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.

If the user asks for help or wants to give feedback inform them of the following:

@vslala
vslala / tictactoe.py
Created September 9, 2025 08:31
Play Tic Tac Toe with Claude 3.7 - GUI built using TKinter
from functools import partial
import random
import re
import threading
import tkinter as tk
from tkinter import messagebox
from typing import Any, Literal, Optional
from langchain_aws import ChatBedrock
@vslala
vslala / s3_multipart_upload.py
Created June 18, 2025 21:10
Resumable multipart upload to S3 Glacier Deep Archive with Python & boto3
import os
import sys
import math
import json
import argparse
import threading
from typing import Dict, List, Any
from concurrent.futures import ThreadPoolExecutor, as_completed
from pydantic import BaseModel, Field
@vslala
vslala / main.tf
Created June 18, 2023 14:54
Terraform deploy lambda with API Gateway
variable "aws_profile" {
description = "AWS Profile For Deployment"
}
variable "aws_region" {
description = "AWS Region For Deployment"
}
variable "project" {
type = string
@vslala
vslala / EventBusDemo.tsx
Last active May 8, 2023 10:43
Example of Using Event Bus for communication between components
interface PostalChannel {
channel: string,
topic: string
}
export const useEventBus = (channel: PostalChannel, callback: (data: any) => void) => {
const [state, setState] = useState({});
useEffect(() => {
const subscription = postal.subscribe({
@vslala
vslala / EventBus.ts
Created May 8, 2023 10:29
Custom Event Bus Using React/Typescript
export interface Subscriber {
name: string
callback: (data: any) => void
}
class EventBus {
private static instance: EventBus | undefined
private subscribers: Map<string, Array<Subscriber>>
constructor() {
@vslala
vslala / tilde-switch.sh
Created December 1, 2022 10:51
This is to replace tilde key (~) with (§) in new mac keyboard
cat << 'EOF' > ~/.tilde-switch && chmod +x ~/.tilde-switch
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}'
EOF
sh .tilde-switch
# To revert back, run the following:
# hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000035},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000064}]}'
@vslala
vslala / persistence.xml
Created September 1, 2022 10:27
Persistence XML for bootstrapping persistence hibernate
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
-->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
@vslala
vslala / BottomUpMergeSort.java
Created June 23, 2021 18:42
Iterative Merge Sort A.K.A Bottom Up Merge Sort
import java.util.Arrays;
public class BottomUpMergeSort implements Sort {
@Override
public int[] sort(int[] input) {
var arr = Arrays.copyOf(input, input.length);
var aux = new int[input.length];
for (var width = 1; width < arr.length; width = 2 * width) {
int i;
for (i = 0; i < arr.length; i = i + 2 * width) {
@vslala
vslala / bitbucket-webhooks-api.py
Created June 13, 2021 08:06
Add/Delete Webhooks in Bitbucket Server Using REST API 1.0
import os
import requests
import json
from app.report import Report
BITBUCKET_BASE_URL = os.environ['BITBUCKET_URL'] # bitbucket base url
ACCESS_TOKEN = os.environ['ACCESS_TOKEN'] # get this token from bitbucket account
JENKINS_BASE_URL = os.environ['JENKINS_URL'] # host url for Jenkins
headers = {