Skip to content

Instantly share code, notes, and snippets.

@jlia0
jlia0 / agent loop
Last active May 6, 2025 09:59
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
@raphaeljolivet
raphaeljolivet / api.py
Created November 15, 2023 16:48
Add custom rest API to streamlit app
# This code adds custom REST api handler at runtime to a running Streamlit app
#
from tornado.web import Application, RequestHandler
from tornado.routing import Rule, PathMatches
import gc
import streamlit as st
@st.cache_resource()
@tyanyaw
tyanyaw / clean-docker-for-mac.sh
Created September 2, 2023 10:20
Cleaning Docker.raw on Mac OS
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@hyperupcall
hyperupcall / settings.jsonc
Last active January 8, 2025 13:29
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@kairusds
kairusds / 1-termux-adb.md
Last active April 12, 2025 13:33
Instructions for connecting Termux's android-tools adb to the current device via Wireless debugging and fixing phantom process killing

Install android-tools if you haven't already:

pkg update ; pkg upgrade
pkg install android-tools

adb pair localhost:port
@mskyttner
mskyttner / duckdb_buenavista_psql.sh
Created January 16, 2023 06:48
duckdb exposed by buenavista proxy and accessed with psql
# start a proxy server for a duckdb in-memory db, using the postgres wire format
docker run -it --rm -p 8080:5433 -e BUENAVISTA_HOST=0.0.0.0 -e BUENAVISTA_PORT=5433 ghcr.io/jwills/buenavista
# somewhere else (or here on the same host), start psql to issue a query against the proxy server
docker run --network host -it --rm postgres:latest psql -h $(hostname) -p 8080 -c "select 42"
@esc5221
esc5221 / delete_gha_runs_by_name.py
Created December 14, 2022 10:36
delete github actions workflow runs by name
# resolves : Is there a way to delete or hide old/renamed Workflows? #26256
# https://github.com/community/community/discussions/26256
from multiprocessing.dummy import Pool as ThreadPool
import requests
TOKEN = "{YOUR_GH_TOKEN}"
OWNER_REPO = "esc5221/example_repo"
DELETE_TARGET_RUN_NAME = "{RUN NAME}"
@RayPS
RayPS / convert-clipboard-image.py
Last active August 13, 2024 03:37
Converting image format in clipboard - macOS Python (Copied as PNG, Paste as JPG)
from PIL import Image
import io
import pasteboard
pb = pasteboard.Pasteboard()
pb_image = pb.get_contents(pasteboard.TIFF)
if pb_image:
image = Image.open(io.BytesIO(pb_image))
if image.mode == 'RGBA':
image.load()
@FreddieOliveira
FreddieOliveira / docker.md
Last active May 6, 2025 14:33
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@xiaopc
xiaopc / draw_table.py
Last active February 5, 2025 14:10
Draw a table using only Pillow
from PIL import Image, ImageFont, ImageDraw
from collections import namedtuple
def position_tuple(*args):
Position = namedtuple('Position', ['top', 'right', 'bottom', 'left'])
if len(args) == 0:
return Position(0, 0, 0, 0)
elif len(args) == 1:
return Position(args[0], args[0], args[0], args[0])