Skip to content

Instantly share code, notes, and snippets.

View antronic's full-sized avatar
✌️
Working from home

Jirachai Chansivanon antronic

✌️
Working from home
View GitHub Profile
I built this app with you, but I'm not technical. I want to understand how it works behind the scenes. Please inspect the ACTUAL project files, configuration and environment in this workspace (don't describe a generic setup), then write me a clear report.
RULES
- Base everything on what you find in the code and config. If something can't be confirmed, label it "Assumed" or "Unknown". Don't guess.
- NEVER print secret values (API keys, passwords, tokens, connection strings). Show variable NAMES only, e.g. MONGO_URL = ••••.
- Explain each section in plain English first (2–3 sentences, as if to a business owner), then give the technical detail.
- Use tables where helpful.
REPORT SECTIONS
#!/usr/bin/env mongosh
/**
* MongoDB Cluster Document Count Comparison Script
*
* This script compares document counts in collections between two MongoDB clusters
* Features:
* - Database selection support
* - Multi-threaded/parallel processing
* - Comprehensive reporting
let getCache = () => {
let maxCache = db.serverStatus().wiredTiger.cache['maximum bytes configured']
let useCache = db.serverStatus().wiredTiger.cache['bytes currently in the cache']
return {
maxCache: maxCache / 1024 / 1024, // Convert to MB
useCache: useCache / 1024 / 1024, // Convert to MB
usePercent: (useCache / maxCache * 100).toFixed(2) + '%', // Percentage of cache used
}
}
@antronic
antronic / try.js
Last active August 11, 2024 11:42
Grab the GUID of a Plex entry on demand
// ==UserScript==
// @name Plex GUID Grabber
// @namespace plex-guid-grabber
// @include http://plex.*/*
// @include https://plex.*/*
// @include *:32400/*
// @version 1.0.3
// @description Grab the GUID of a Plex entry on demand
// @icon https://app.plex.tv/desktop/favicon.ico
// @homepageURL https://gist.githubusercontent.com/antronic/b9eaeb6ad4a61ddff0190cade75c8572/raw/70453287de9400e2677da29036d28b81402d77a7/try.js
@antronic
antronic / hareshi-my-list.min.js
Last active August 11, 2024 11:42
Hareshi's Saved list
// ==UserScript==
// @name Hareshi-My_List
// @match https://www.hareshi.net/browse/anime*
// @include https://www.hareshi.net/browse/anime*
// @description Hareshi's Saved list
// @namespace hareshi-my-list
// @version 2024-08-11
// @author Jirachai Chansivanon
// @icon https://www.google.com/s2/favicons?sz=64&domain=hareshi.net
// @downloadURL https://raw.githubusercontent.com/antronic/hareshi-my-list/main/build/hareshi-my-list.tampermonkey.min.js
const fs = require("fs");
const path = require("path");
const { SearchIndexClient, AzureKeyCredential } = require("@azure/search-documents");
// Replace with your search service name and admin api key
const searchServiceName = "<your-search-service-name>";
const adminApiKey = "<your-search-service-admin-api-key>";
// Replace with your index name and field name
const indexName = "<your-index-name>";
<html>
<head>
<title>Progress time</title>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
}
#wrapper {
<html>
<head>
<title>Just a Clock!</title>
<style type="text/css">
html, body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"
}
</style>
</head>
<body>
@antronic
antronic / embedded_countdown.js
Created March 31, 2020 10:18
Idea for inject embedded countdown DOM element
(function() {
const today = new Date()
const _targetTime = prompt('Input your end time', `${today.getMonth() + 1}/${today.getDate()}/${today.getFullYear()} ${today.getHours()}:${today.getMinutes()}:${today.getSeconds()}`)
const targetTime = new Date(_targetTime)
if (isNaN(targetTime)) {
throw new Error('Your time input is invalid date format.')
}
@antronic
antronic / jsbkk-seek.html
Created February 8, 2020 10:23
JSBKK - seek code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Meow~</title>
</head>
<body>
Hello JSBKK
</body>