Skip to content

Instantly share code, notes, and snippets.

View narenmanoharan's full-sized avatar
:shipit:

Naren Manoharan narenmanoharan

:shipit:
View GitHub Profile
@narenmanoharan
narenmanoharan / wealth_managers.py
Created August 5, 2023 17:59
Script for the top 10K wealth managers in the US
import os
import pandas as pd
from sec_api import FormAdvApi
from loguru import logger
from tqdm import tqdm
import plotly.express as px
DATA_FILE_PATH = "wealth_managers.csv"
RESULTS_PER_PAGE = 50
@narenmanoharan
narenmanoharan / bench.md
Last active July 2, 2023 13:26
Benchmark new FastAPI server against Ktor server (10 runs)
old_endpoint new_endpoint method old_backend_mean new_backend_mean mean_change old_backend_p50 new_backend_p50 p50_change old_backend_p95 new_backend_p95 p95_change
/me /me GET 0.66839 0.53476 -19.99% 0.56474 0.553 -2.08% 0.88074 0.58733 -33.36%
/me/preferences /me/preferences GET 0.57466 0.56853 -1.07% 0.56219 0.56679 +0.82% 0.89032 0.58241 -34.69%
/me/preferences /me/preferences PUT 0.74
@narenmanoharan
narenmanoharan / webhook.js
Last active February 23, 2023 16:36
Node example for a POST endpoint to consume wolfia webhooks
var express = require('express');
var crypto = require('crypto');
var router = express.Router();
router.post('/', function (req, res, next) {
const isExpired = isWebhookExpired(req);
const isVerified = isWebhookVerified(req);
if (isVerified && !isExpired) {
processWebhook(req.body);
res.status(200).send('OK');
@narenmanoharan
narenmanoharan / wolfia_upload.sh
Created November 18, 2022 01:01
CLI script to upload android apks to wolfia
#!/bin/bash
set -eo pipefail
if [[ -z ${WOLFIA_API_KEY_ID+x} ]]; then
echo "Please set WOLFIA_API_KEY_ID in your environment variable. You can learn how to generate an API key here (https://wolfia.com/docs/#generate-an-api-key)"
elif [[ -z ${WOLFIA_API_KEY_SECRET+x} ]]; then
echo "Please set WOLFIA_API_KEY_SECRET in your environment variable."
elif (( $# != 1 )); then
echo "Please provide the path of apk to be uploaded (eg. ../Downloads/clubhouse.apk)"
@narenmanoharan
narenmanoharan / visual_regression.txt
Created April 29, 2020 21:14
Text report of visual regressions
-----------------------------------------------------------------------------------------------------
| createfutureexpense_unknown_gce_x86_phone_28.png | MATCH |
| dashboard_accounts_tabs_unknown_gce_x86_phone_28.png | MATCH |
| dashboard_goals_tabs_unknown_gce_x86_phone_28.png | MATCH |
| newpersonaltaxableaccount_success_unknown_gce_x86_phone_28.png | MATCH |
-----------------------------------------------------------------------------------------------------
@narenmanoharan
narenmanoharan / flank.yml
Created April 29, 2020 20:53
Flank configuration for pulling and downloading files from Firebase
directories-to-pull:
- /sdcard/screenshots/
files-to-download:
- .*\.png$
@narenmanoharan
narenmanoharan / screenshot.kt
Last active April 29, 2020 20:50
Capturing a screenshot of the rootView
// Simple screenshot
ScreenCaptor.takeScreenshot(
view = rootView,
screenshotFilename = "my_favorite_screenshot"
)
// Screenshot with all the configurations
ScreenCaptor.takeScreenshot(
view = rootView,
screenshotFilename = "my_favorite_screenshot",
@narenmanoharan
narenmanoharan / FutureExpenseTest.kt
Created April 29, 2020 19:39
Sample integration test with action and assertions.
@Test
fun createFutureExpense() {
goToLoginScreen()
.login(user.email, user.password)
.check(thatOnDashboardScreen())
.captureScreenshot(rootView, "dashboard_accounts_tabs")
.clickGoalsToggle()
.captureScreenshot(rootView, "dashboard_goals_tabs")
.createEvent()
.check(thatOnCreatePathEventScreen())
@narenmanoharan
narenmanoharan / flank_setup.gradle
Created April 29, 2020 19:24
Custom gradle extension to setup flank
stagingServerTest {
devices = [new Device("Pixel2", 28)]
testTargets = "package com.wealthfront.test.stagingserver"
variantName = "StagingServerTestRelease"
flakyTestAttempts = 1
testShards = 4
smartFlankGcsPath = "gs://android_flank/staging_server_test.xml"
}
➜ wf-android git:(master) ./filemover.sh
Loading filemover...
File mover for wf-android
Please enter the module to move files to (e.g. :features:auth): :features:login
Please enter the module to move files from (e.g. :features:legacy): :features:legacy
Please enter the package(s) you wish to move, separated by commas: login