Skip to content

Instantly share code, notes, and snippets.

View IMperiumX's full-sized avatar
😎
😳🕶️🤏

Lengrad IMperiumX

😎
😳🕶️🤏
View GitHub Profile
@IMperiumX
IMperiumX / ciu.html
Created March 6, 2025 19:22
Interactive Mind Map of Coding Interview University Curriculum (using Markmap) This HTML file renders an interactive mind map of the Coding Interview University curriculum using the Markmap JavaScript library. It transforms a Markdown outline into a zoomable, collapsible mind map visualization.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Coding Interview University Mind Map (Markmap)</title>
<style>
body {
font-family: sans-serif;
margin: 0; /* Remove default margin */
@IMperiumX
IMperiumX / init-replica.sh
Created February 22, 2025 13:58
Initialize PosgreSQL replica overriding PGDATA
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
DATA_DIR="/var/lib/postgresql/data"
# Check if the data directory is empty
if [ "$(ls -A "$DATA_DIR")" ]; then
@IMperiumX
IMperiumX / gimini2lc.py
Created February 14, 2025 11:03
Automate LC problems archiving
"""
I use this System Instruction and give the LLM LC URL or desctiption and it take care of the rest
repo => [leetcode-solutions](https://github.com/IMperiumX/leetcode-solutions)
- Goal: To automatically generate a well-structured, documented, and diverse LeetCode solution repository based on user input.
- Input: The user will provide one or more of the following:
- LeetCode Problem Name (e.g., "Two Sum")
- LeetCode Problem Number (e.g., "1")
- LeetCode Problem URL (e.g., "<https://leetcode.com/problems/two-sum/>")
- Problem Description (text of the problem statement)
- Possible Solution (code in any supported language)
@IMperiumX
IMperiumX / jsontomd.py
Created February 14, 2025 08:02
Convert a conversation from aistudio (Gemini) to markdown format
#!/usr/bin/env python3
import json
from pathlib import Path
import sys
def is_json_file(file_path):
"""
Check if file contains valid JSON regardless of extension.
@IMperiumX
IMperiumX / quran-recitation.sh
Created February 6, 2025 09:11
Fetch Quran recitiation from mp3quran.net
#!/bin/bash
# Set the download directory
download_dir="quran_downloads"
# Create the download directory if it doesn't exist
mkdir -p "$download_dir"
# Loop through the numbers 1 to 114
for i in $(seq 1 114); do

Dear ChatGPT,

I would like to request your assistance in creating an AI-powered prompt rewriter, which can help me rewrite and refine prompts that I intend to use with you, ChatGPT, for the purpose of obtaining improved responses. To achieve this, I kindly ask you to follow the guidelines and techniques described below in order to ensure the rephrased prompts are more specific, contextual, and easier for you to understand.

Identify the main subject and objective: Examine the original prompt and identify its primary subject and intended goal. Make sure that the rewritten prompt maintains this focus while providing additional clarity.

Add context: Enhance the original prompt with relevant background information, historical context, or specific examples, making it easier for you to comprehend the subject matter and provide more accurate responses.

Ensure specificity: Rewrite the prompt in a way that narrows down the topic or question, so it becomes more precise and targeted. This may involve specifying a par

@IMperiumX
IMperiumX / todo
Last active September 1, 2023 02:56
TODO app
#!/bin/env python
#
# Instantly Motivating Todo App
#
# Tired of complex todo apps? This minimalistic solution is your answer.
# I've explored countless todo tools, apps, scripts, and even the ones
# that are still in development. Yet, they all ended up untouched, defeating
# their purpose.
#
# Introducing `doitnow`, a revolutionary approach. It does just one thing:
@IMperiumX
IMperiumX / vtt2text
Last active March 21, 2025 11:46 — forked from glasslion/vtt2text.py
This script convert youtube subtitle file(vtt) to plain text (with no duplicated).
#!/usr/bin/env python3
import re
import os
import glob
def vtt_to_txt(vtt_filepath, txt_filepath):
"""Converts a VTT file to plain text, removing timestamps, header, and duplicates.
"""
try:
with open(vtt_filepath, 'r', encoding='utf-8') as vtt_file, \
- This page is a collection of some of the Advanced queries from the [[Datalog]] channel on the [[Logseq/Discord]] server. #datalog
id:: 61db13f4-75e8-4f87-ad60-3ac3479c5fc8
- ### Resources
- [link: The first message on the datalog channel](https://discord.com/channels/725182569297215569/743139225746145311/743139795865174119)
- [link: Logseq docs - Advanced queries](https://docs.logseq.com/#/page/advanced%20queries)
- [link: Logseq datascript schema](https://gist.github.com/tiensonqin/9a40575827f8f63eec54432443ecb929)
- [link: Logseq frontend db model](https://github.com/logseq/logseq/blob/master/src/main/frontend/db/model.cljs)
- [link: How to Graph Your Data - talk by Paula Gearon](https://youtu.be/tbVwmFBnfo4)
- [link: Domain modelling with datalog - talk by Norbert Wojtowicz](https://youtu.be/oo-7mN9WXTw)
- [link: Athens Research ClojureFam](https://github.com/athensresearch/ClojureFam)