Skip to content

Instantly share code, notes, and snippets.

@jlia0
jlia0 / agent loop
Last active March 25, 2025 14:55
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@ingo-eichhorst
ingo-eichhorst / animated-flowchart-dotted.html
Last active March 25, 2025 14:54
Mermaid Animated Dotted Line
<!DOCTYPE html>
<html>
<head>
<style>
.flowchart-link {
stroke-dasharray: 4, 4 !important;
animation: flow 1s linear infinite;
stroke-width: 2px !important;
}
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active March 25, 2025 14:54
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@S4tyendra
S4tyendra / Complete VPS Setup Guide - Ubuntu Server.md
Created January 25, 2025 05:24
A comprehensive guide for setting up and optimizing an Ubuntu VPS server with essential services and security configurations.

Features:

  • 🔒 Secure SSH configuration
  • 🐍 Python environment with deadsnakes PPA
  • 🚀 Nginx with UI management
  • 🐳 Docker and Docker Compose
  • 🔑 SSL/TLS with Let's Encrypt
  • 📊 MongoDB Atlas integration
  • 💾 Swap and system optimization
  • 🔄 Auto-renewal and maintenance scripts
  • ⏰ Custom MOTD with system stats
@khronokernel
khronokernel / electron_patcher.py
Last active March 25, 2025 14:53
Electron and Chrome patcher to force OpenGL rendering
"""
electron_patcher.py: Enforce 'use-angle@1' in Chrome and Electron applications
Version 1.0.0 (2024-08-11)
"""
import enum
import json
from pathlib import Path
@chongchonghe
chongchonghe / solar_system.py
Last active March 25, 2025 14:53
Python solar system (a file in this repo https://github.com/chongchonghe/Python-solar-system )
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from astropy.time import Time
from astroquery.jplhorizons import Horizons
sim_start_date = "2018-01-01" # simulating a solar system starting from this date
sim_duration = 2 * 365 # (int) simulation duration in days
m_earth = 5.9722e24 / 1.98847e30 # Mass of Earth relative to mass of the sun
@fourcube
fourcube / CVE-2025-29927.bcheck
Created March 24, 2025 07:55
Burp BCheck for CVE-2025-29927 (Next.js middleware bypass)
metadata:
language: v2-beta
name: "CVE-2025-29927 - Next.js middleware bypass"
description: "Checks for differences in responses when using different x-middleware-subrequest header paths"
author: "Chris Grieger - blueredix.com"
tags: "next.js", "middleware"
run for each:
middleware_value = "pages/_middleware",
"middleware",
@tuliofaria
tuliofaria / lint
Created March 25, 2025 14:09
lint
#!/bin/sh
STAGED_FILES=$(git diff-index HEAD --name-only --cached | grep -E '\.(js|jsx|ts|tsx)$' || true)
if [[ -z $STAGED_FILES ]]
then
echo 'No relevant staged files, no need to run eslint.'
exit # no relevant staged files, no need to run eslint
fi
# Checks if any staged files have unstaged changes
@petelacey
petelacey / Dockerfile
Last active March 25, 2025 14:52
Docker Compose setup for Elixir, Phoenix, and Postgres
FROM elixir:latest
# Install debian packages
RUN apt-get update && \
apt-get install --yes build-essential inotify-tools postgresql-client git && \
apt-get clean
ADD . /app
# Install Phoenix packages
@pesterhazy
pesterhazy / indexeddb-problems.md
Last active March 25, 2025 14:51
The pain and anguish of using IndexedDB: problems, bugs and oddities

This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).

Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.

Backing file on disk (WAL file) keeps growing (Safari)

When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.

Random exceptions when working with a large number of indexeddb databases (Safari)