Skip to content

Instantly share code, notes, and snippets.

View drreddy's full-sized avatar

D. Rajeev. Reddy drreddy

View GitHub Profile
@alexanderytaylor
alexanderytaylor / pixel.js
Created March 27, 2024 21:16
shopify-posthog-custom-web-pixel
const postHogApiKey = "POSTHOG_API_KEY";
const postHogEndpoint = "https://app.posthog.com/capture";
const headers = {
"Content-Type": "application/json",
};
// Customer information
const customer = init.data.customer;
const { id, email, firstName, lastName } = customer;
const fullName = `${firstName} ${lastName}`;
@veekaybee
veekaybee / normcore-llm.md
Last active October 13, 2025 07:06
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@blanklob
blanklob / ga4-shopify-custom-pixel.js
Created July 1, 2023 23:40
Google Analytics 4 Shopify Custom Pixel
// Step 1. Add and initialize your third-party JavaScript pixel (make sure to exclude HTML)
// Replace with you GA4 Tag
const TAG_ID = 'G-XXXXXXXXXX';
const script = document.createElement('script');
script.setAttribute('src', `https://www.googletagmanager.com/gtag/js?id=${TAG_ID}`);
script.setAttribute('async', '');
document.head.appendChild(script);
window.dataLayer = window.dataLayer || [];
@ranic
ranic / mixpanel-proxy-example.html
Last active September 15, 2025 09:41
Example of setting up tracking via a proxy.
<html>
<head>
<title>Mixpanel Tracking Proxy Demo</title>
<script type="text/javascript">
/**
* Configuration Variables - CHANGE THESE!
*/
const MIXPANEL_PROJECT_TOKEN = YOUR_MIXPANEL_PROJECT_TOKEN; // e.g. "67e8bfdec29d84ab2d36ae18c57b8535"
const MIXPANEL_PROXY_DOMAIN = YOUR_PROXY_DOMAIN; // e.g. "https://proxy-eoca2pin3q-uc.a.run.app"
@veekaybee
veekaybee / searchrecs.md
Last active February 3, 2025 14:37
Understanding search and recommendations

How are search and recommendations the same, and how are they different?

TL;DR:

  • The design of both search and recommendations is to find and filter information
  • Search is a "recommendation with a null query"
  • Search is "I want this", recommendations is "you might like this"
# FastAPI + MongoDB
# Option 2: Use a Single MongoClient.
from pymongo import MongoClient
from fastapi import FastAPI
import os
from typing import List
# Sample Movie Database from Atlas MongoDB
DB = "sample_mflix"
MSG_COLLECTION = "movies"
@slavirok
slavirok / benthos_eh_to_kafka_conf.yaml
Last active April 28, 2024 15:19
BenthOS AzureEventHub Source
input:
kafka:
addresses:
- ${EVENTHUB_BOOTSTRAP_SERVER}
topics: [${EVENTHUB_TOPIC}]
tls:
enabled: true
skip_cert_verify: true
root_cas_file: ""
client_certs: []
@davidagee
davidagee / Druid basic-auth setup.md
Last active April 2, 2024 09:54
Setting up basic-auth roles and permissions in Druid

Setting up basic auth users & permissions in Druid

Configuring Druid for basic-auth

Note: This gist does not cover enabling TLS for Druid. Remember that basic-auth is useless without TLS. The purpose of this guide is to set up users, roles and permissions for testing.

  • Add the basic-auth extension to Druid in the common.runtime.properties file, e.g. in conf-quickstart/druid/_common/common.runtime.properties:
druid.extensions.loadList=["druid-basic-security", "druid-histogram", "druid-datasketches", "druid-kafka-indexing-service", "imply-utility-belt"]

Podcasts for Data Science & Stuff

I asked the Twittersphere for data science (& tangentially-related) podcasts recommendations, and got a much bigger response than I expected with some really superb recommendations, so I created a gist with the suggestions I received. They're arranged alphabetically by name below, along with relevant Twitter accounts, links, and names of the hosts (if I could find them).

Shoot me a tweet @bennyjtang if you have more suggestions to add to this list!

Original Twitter thread

Adversarial Learning

# Code adapted from Tensorflow Object Detection Framework
# https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb
# Tensorflow Object Detection Detector
import numpy as np
import tensorflow as tf
import cv2
import time