Skip to content

Instantly share code, notes, and snippets.

View lethargicpanda's full-sized avatar

Thomas Ezan lethargicpanda

View GitHub Profile
@lethargicpanda
lethargicpanda / SKILL.md
Last active April 6, 2026 21:52
Google Photo Skill
name search_google_photos
description Searches the user's Google Photos library using the system's Search Activity Alias.
tools
intent_dispatch

Search Google Photos

This skill triggers the native search interface of Google Photos to find specific people, objects, or locations.

@lethargicpanda
lethargicpanda / server.py
Created August 18, 2025 00:08
Experimental ADB MCP server
from mcp.server.fastmcp import FastMCP
import subprocess
# Create an MCP server
mcp = FastMCP("ADB MCP")
@mcp.tool()
def get_devices() -> str:
"""Get the list of Android devices connected to the laptop"""
@lethargicpanda
lethargicpanda / agent.py
Created August 18, 2025 00:04
AI Agent using Gemini 2.5 Pro and a custom ADB MCP server
import asyncio
import os
from mcp_use import MCPAgent, MCPClient
from langchain_anthropic import ChatAnthropic
from langchain_openai import ChatOpenAI
from langchain_google_genai import ChatGoogleGenerativeAI
async def main():
print("hello!")
config = {
@lethargicpanda
lethargicpanda / PotassiumMainScreen.kt
Created March 20, 2024 04:46
Very basic compose scaffolding for Potassium.
@Composable
fun MainScreen(viewModel: ViewModel) {
val cameraIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
var bitmap by remember { mutableStateOf<Bitmap?>(null) }
val textResponse by viewModel.textGenerated.observeAsState()
val isGenerating by viewModel.isGenerating.observeAsState(false)
// Get your image
val resultLauncher =
rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) { result: ActivityResult ->
@lethargicpanda
lethargicpanda / demo_mode.sh
Last active April 22, 2018 20:09
Demo Mode for the Android System UI - force the status bar into a fixed state, useful for taking screenshots with a consistent status bar state, or testing different status icon permutations. Demo mode is available in recent versions of Android. https://android.googlesource.com/platform/frameworks/base/+/master/packages/SystemUI/docs/demo_mode.md
adb shell settings put global sysui_demo_allowed 1
@lethargicpanda
lethargicpanda / rebaseandsqua.sh
Created March 19, 2015 04:49
From rebaseandsqua.sh
#!/bin/sh
set -e
# Get the current branch name.
branch=`git rev-parse --abbrev-ref HEAD`
# Determine the commit at which the current branch diverged.
ancestor=`git merge-base master HEAD`
# Stash any uncommited, changed files.
git stash --all
# Revert the branch back to the ancestor SHA.
@lethargicpanda
lethargicpanda / flavor_manifest.xml
Created November 24, 2014 04:00
Remove permission in manifest
<permission
android:name="your.package.name.permission.BLA"
tools:node="remove"/>
@lethargicpanda
lethargicpanda / duplicate_permission_failure.log
Created November 24, 2014 03:58
INSTALL_FAILED_DUPLICATE_PERMISSION
Failure [INSTALL_FAILED_DUPLICATE_PERMISSION perm=your.package.name.permission.BLA pkg=your.package.name]
@lethargicpanda
lethargicpanda / android_screen_record.sh
Created September 16, 2014 18:53
Android Screen recorder [Script]
adb shell screenrecord /sdcard/video.mp4
adb pull /sdcard/video.mp4
// To instantiate a RippleDrawable:
// new RippleDrawable(null, null), the default constructor isn't public.
// Unfortunately, this has no colors set, so the app will crash, here's another way
int[] attrs = new int[] { android.R.attr.selectableItemBackground};
TypedArray array = getContext().obtainStyledAttributes(attrs);
Drawable drawableFromTheme = array.getDrawable(0);
array.recycle();
setBackground(drawableFromTheme);