Skip to content

Instantly share code, notes, and snippets.

View ganeshan's full-sized avatar

Ganeshan Venkataraman ganeshan

  • Sterling,MA
View GitHub Profile
@ganeshan
ganeshan / parquet-cli.sh
Created August 12, 2024 14:26 — forked from mneedham/parquet-cli.sh
An intro to Apache Parquet
# The NYC Taxis Dataset - https://www1.nyc.gov/site/tlc/about/tlc-trip-record-data.page
pip install parquet-cli
parq data/yellow_tripdata_2022-01.parquet
parq data/yellow_tripdata_2022-01.parquet --schema
parq data/yellow_tripdata_2022-01.parquet --head 10
@ganeshan
ganeshan / PostgreSQL-EXTENSIONs.md
Created March 7, 2024 10:50 — forked from joelonsql/PostgreSQL-EXTENSIONs.md
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

@ganeshan
ganeshan / python_decorator_guide.md
Created December 15, 2023 13:16 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@ganeshan
ganeshan / tree.sql
Created July 7, 2023 09:50 — forked from dylan-evans/tree.sql
An sqlite3 demonstration of hierarchical data
-- A method for storing and retrieving hierarchical data in sqlite3
-- by using a trigger and a temporary table.
-- I needed this but had trouble finding information on it.
-- This is for sqlite3, it mostly won't work on anything else, however
-- most databases have better ways to do this anyway.
PRAGMA recursive_triggers = TRUE; -- This is not possible before 3.6.18
-- When creating the Node table either use a primary key or some other
@ganeshan
ganeshan / Application.java
Created February 27, 2023 10:36 — forked from nickname55/Application.java
apache commons cli example
import java.util.Arrays;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
public class Application {
@ganeshan
ganeshan / intercept.js
Created February 15, 2023 16:39 — forked from suprememoocow/intercept.js
AJAX timing interceptor: this class intercepts all AJAX calls and records the time taken for the HTTP request to complete. These timings are posted back to the server in batches, if there are any to send, about every two seconds. Tested in Firefox, Chrome
(function(XHR) {
"use strict";
var stats = [];
var timeoutId = null;
var open = XHR.prototype.open;
var send = XHR.prototype.send;
/*
Step 1
Create NorthWindContacts database in SSMS
Step 2
Copy this script into SSMS, select NorthWindContacts
Step 3
Run the script
@ganeshan
ganeshan / S3MultipartUpload.java
Created January 13, 2023 13:43 — forked from prameshbhattarai/S3MultipartUpload.java
Uploading InputStream to AWS S3 without Content-Length using Multipart Upload - JAVA
import com.amazonaws.regions.Regions;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.internal.Constants;
import com.amazonaws.services.s3.model.*;
import lombok.extern.log4j.Log4j2;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@ganeshan
ganeshan / create_x509_certs.md
Created November 6, 2022 16:35 — forked from dasniko/create_x509_certs.md
Creating self signed tls certificates with self-signed root CA