Skip to content

Instantly share code, notes, and snippets.

View Kondasamy's full-sized avatar
👨‍💻
Busy

Kondasamy Jayaraman Kondasamy

👨‍💻
Busy
View GitHub Profile
@Kondasamy
Kondasamy / convert_intercom_to_csv.py
Created January 27, 2026 05:20
Convert Intercom S3 backup JSONL files to cleaned CSV
#!/usr/bin/env python3
"""
Convert Intercom S3 backup JSONL files to cleaned CSV.
Intercom exports hourly conversation backups as JSONL files to S3. This script:
1. CLEANUP: Removes zero-byte files from S3 (empty hourly exports)
Usage: python convert_intercom_to_csv.py --delete-empty
2. EXPORT: Converts all JSONL files to a single CSV with one row per conversation
@Kondasamy
Kondasamy / statusline-command.sh
Created January 13, 2026 06:23
Claude Code's - status line enhancement
#!/bin/bash
# Claude Code statusline - single line with left/right alignment
# File: ~/.claude/statusline-command.sh
# Add to ~/.claude/settings.json:
# {
# "statusLine": {
# "type": "command",
# "command": "/Users/you/.claude/statusline-command.sh"
# }
# }
@Kondasamy
Kondasamy / dialogflow-cx-jwt.md
Created December 24, 2024 06:37
Dialogflow CX - personalize responses using the username from the JWT token
@Kondasamy
Kondasamy / gcp-pubsub-sqs-ordering.md
Created December 24, 2024 04:23
GCP Equivalent - Solving Complex Ordering Challenges with Amazon SQS FIFO Queues

Question

Can we build similar solution using GCP managed services? Can you please forward any reference or any example, we are considering few options for modernization? Solving Complex Ordering Challenges with Amazon SQS FIFO Queues

Answer

You can build a similar solution using GCP managed services. Here's how you can implement a similar message ordering solution using Google Cloud Platform services:

  1. Using Cloud Pub/Sub with Ordering Keys
  • Cloud Pub/Sub is GCP's equivalent to AWS SQS
  • It supports message ordering using Ordering Keys (similar to SQS FIFO message groups)
@Kondasamy
Kondasamy / bq-exporter.go
Last active September 13, 2024 06:58
Golang Bigquery exporter
package main
import (
"context"
"fmt"
"log"
"sync"
"cloud.google.com/go/bigquery"
"google.golang.org/api/option"
@Kondasamy
Kondasamy / es-to-csv.md
Created September 13, 2024 06:46
Export ElasticSearch index to CSV

To export an Elasticsearch (ES) index as a CSV file, you can follow these steps:

  1. Use the Elasticsearch Scroll API to retrieve large amounts of data.
  2. Process the retrieved data and format it as CSV.
  3. Write the formatted data to a file.

Attaching the Python script that does this process.

To use this script:

@Kondasamy
Kondasamy / type-bounds.scala
Created November 29, 2022 06:10 — forked from retronym/type-bounds.scala
Tour of Scala Type Bounds
class A
class A2 extends A
class B
trait M[X]
//
// Upper Type Bound
//
def upperTypeBound[AA <: A](x: AA): A = x
@Kondasamy
Kondasamy / dict_aggregator.py
Created April 9, 2019 03:11
Grouping list of dictionary to dictionary
from collections import defaultdict
list_of_dict = [{'mapKey': '1A', 'coInsurance': 70.00},
{'mapKey': '2A', 'coInsurance': 50.00},
{'mapKey': '1A', 'coInsurance': 25.00}]
result_dict = defaultdict(list)
for item in list_of_dict:
result_dict[item['mapKey']].append(item['coInsurance'])
/*
* Function to extract sub array with 3 elements, which is of maximum product and ascending order
*
*/
public static int[] subArrayWithMaxProduct(int[] inputArray)
{
int maxProduct = 0;
int[] subArrayWithLargestProduct = new int[3];
for (int i = 1; i < inputArray.length - 1; i++)
{
/*
* Function to check if singly linked list is palindrome or not
*/
boolean isPalindrome(Node head)
{
slow_ptr = head; fast_ptr = head;
Node prev_of_slow_ptr = head;
Node midnode = null;
boolean res = true;