Skip to content

Instantly share code, notes, and snippets.

View xtreme-sameer-vohra's full-sized avatar

Sameer Vohra xtreme-sameer-vohra

View GitHub Profile
@xtreme-sameer-vohra
xtreme-sameer-vohra / application.ex
Created March 21, 2025 14:23
Elixir custom logging filter
# Add line to application
:logger.add_primary_filter(:noise_filter, {&DevelopmentLogger.filter/2, []})
@xtreme-sameer-vohra
xtreme-sameer-vohra / openai_api.ex
Last active January 14, 2025 18:51
Elixir OpenAI API Perf Test
defmodule OpenAIAPI do
require Logger
def run_tests(num_samples \\ 10) do
# Test prompt that will be consistent across all runs
test_messages = [
%{"role" => "user", "content" => "Write me a haiku about Toronto"}
]
IO.puts("\n=== Performance Test Results ===\n")
@xtreme-sameer-vohra
xtreme-sameer-vohra / gen_lambda_payload.py
Created December 12, 2024 19:55
Generate CloudWatch Log payload to test AWS Lambda for New Relic
import json
import gzip
import base64
payload = {
"logGroup": "/ecs/SOME_APP",
"logStream": "ecs/SOME_APP/SOME_OTHER_ID",
"logEvents": [
{
"message": "THIS IS A TEST MESSAGE",
@xtreme-sameer-vohra
xtreme-sameer-vohra / bstress.go
Created March 9, 2020 23:43
baggageclaim stress util
package main
import (
"archive/tar"
"flag"
"os"
"path/filepath"
"sync"
"time"
@xtreme-sameer-vohra
xtreme-sameer-vohra / booklit.sh
Last active September 18, 2020 21:22
setbooklit
#!/bin/bash
pushd /tmp
curl -O https://gist.githubusercontent.com/xtreme-sameer-vohra/287ae0856f2eda79e771621e136576b5/raw/7e00582b9967f8def2af1c83073696e7becf904d/booklit.yml
fly -t dev login -c http://localhost:8080 -p test -u test
fly -t dev sp -n -p booklit -c booklit.yml
fly -t dev up -p booklit
@xtreme-sameer-vohra
xtreme-sameer-vohra / refactor.md
Last active December 30, 2019 17:15
Concourse refactor notes

Principles

Nomenclature

  • Artifact Concourse abstraction for binary objects that need to be stored & retrived in order to execute steps, jobs and pipelines. Agnostic of Runtime Storage.
  • ArtifactSource The complementary object associated with an Artifact that stores and retrieves the binary objects needed by Concourse. Implements the streaming functionality. Implemented by each Runtime Storage.

TODOs

Steps defined in exec should not reference volumes

@xtreme-sameer-vohra
xtreme-sameer-vohra / booklit.yml
Last active September 18, 2020 21:21
Concourse Sample Pipeline - Booklit
resources:
- name: booklit
type: git
source: {uri: "https://github.com/vito/booklit"}
jobs:
- name: unit
plan:
- get: booklit
trigger: true