Skip to content

Instantly share code, notes, and snippets.

View kaushalvivek's full-sized avatar
Building cool stuff.

Vivek Kaushal kaushalvivek

Building cool stuff.
View GitHub Profile
@kaushalvivek
kaushalvivek / ticket_summary_prompt.txt
Last active February 24, 2024 11:27
[prompt] summarise tickets
# Mission
You are an expert software bug analyst at ${org.name}. Your job is to create an actionable summary of ${bucketName} issues that have recently been ${activity.toString()}. The summary is used to find broad, actionable patterns in issues so that the engineering team at {$org.name} can plan improvements for sub-systems and prioritize work.
# Context
## {org.name}
${org.description}
## Scenario
- Users, customer success managers have product teams at {$org.name} have reported bugs by creating tickets in Linear, {$org.name}'s ticket management system.
- The ticket's title and description are added by the person reporting them, so often might not capture all relevant engineering system details.
@kaushalvivek
kaushalvivek / us-visa.py
Created August 26, 2023 09:45
A short, dirty lambda function, to poll for US Visa appointment updates and email you, when faster slot opens up
import os
import re
import ssl
import smtplib
from datetime import datetime, timedelta
import requests
from bs4 import BeautifulSoup
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
@kaushalvivek
kaushalvivek / rust-var-1.rs
Last active August 2, 2021 05:16
Rust Variables 1
let var = 5; // immutable variable, Rust guesses datatype
let varWithType:i32 = 5; // immutable variable, datatype specified
let mut mutableVar:i32 = 5; // mutable variable with datatype
let (varA, varB) = (10, 20); // Rust identifies patterns for variable assignment
const CONST_VAR:i32 = 9; // constant declaration, immutable, very fast, requires data-type specification
@kaushalvivek
kaushalvivek / array-vector.c
Last active June 13, 2021 04:43
sample code to demo demoss-ing
// Variables replaced by single value arrays
#include <stdio.h>
int main() {
int a[1],b[1],op[1],ans[1];
printf ("Enter first number: ");
scanf("%d", &a);
printf ("Enter second number: ");
scanf("%d", &b);
here:
printf("Choose what you want to do:\n1 for a+b\n2 for a~b\n3 for a*b\n4 for a^b\n");
@kaushalvivek
kaushalvivek / replace_s3_content_type.py
Created May 27, 2021 18:06
Update ContentType for all objects in an S3 bucket based on file extension.
# imports
import boto3
import json
# constants
# note that the access key should be of a user who has write access to the bucket named here
BUCKET_NAME = '<>'
AWS_ACCESS_KEY_ID = '<>'
AWS_SECRET_ACCESS_KEY = '<>'
@kaushalvivek
kaushalvivek / consumeSqs.js
Created March 28, 2021 06:42
A function to consume messages for AWS SQS
const AWS = require('aws-sdk')
const https = require('https')
const sqsConfig = {
apiVersion: "2012-11-05",
accessKeyId: "<sqs-user's ACCESS_KEY_ID here>",
secretAccessKey: "<sqs-user's SECRET_ACCESS_KEY here>",
region: "AWS REGION HERE" // you can see your AWS region in your queue ARN, like:
// arn:aws:sqs:<AWS REGION>:user-id:queue-name
}
@kaushalvivek
kaushalvivek / enqueueSqs.js
Created March 28, 2021 06:40
A function to queue messages to AWS SQS
const aws = require('aws-sdk')
const uuid = require('uuid')
const splitArray = require('split-array')
const sqsConfig = {
apiVersion: "2012-11-05",
accessKeyId: "<sqs-user's ACCESS_KEY_ID here>",
secretAccessKey: "<sqs-user's SECRET_ACCESS_KEY here>",
region: "AWS REGION HERE" // you can see your AWS region in your queue ARN, like:
// arn:aws:sqs:<AWS REGION>:user-id:queue-name
from minio import Minio
from minio.error import ResponseError
import json
import os
minioClient = Minio(os.environ['MLFLOW_S3_ENDPOINT_URL'].split('//')[1],
access_key=os.environ['AWS_ACCESS_KEY_ID'],
secret_key=os.environ['AWS_SECRET_ACCESS_KEY'],
secure=False)
@kaushalvivek
kaushalvivek / rollback_node_deploy.sh
Created May 21, 2020 09:40
Deploying Hexo Without Node Error
#!/bin/bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm use 13.1.0
hexo generate
hexo clean
hexo deploy
@kaushalvivek
kaushalvivek / server.js
Last active April 14, 2020 11:27
Node server template for MERN stack development
// Imports
const express = require('express');
const cors = require('cors');
const mongoose = require('mongoose');
// Get environment
require('dotenv').config();
// Create express web app, specify port
const app = express();