Skip to content

Instantly share code, notes, and snippets.

View mpiannucci's full-sized avatar

Matthew Iannucci mpiannucci

View GitHub Profile
@leerob
leerob / agent.py
Created July 30, 2025 23:14
agent.py
import os
import json
import subprocess
from anthropic import Anthropic
# Tool definitions
TOOLS = [
{
"name": "list_files",
"description": "List files and directories at a given path",
@ianhi
ianhi / tile.py
Last active May 15, 2025 14:38
Xarray Tile Accessor
from typing import overload
import mercantile
import xarray as xr
@xr.register_dataset_accessor("tile")
@xr.register_dataarray_accessor("tile")
class TileAccessor:
def __init__(self, xarray_obj):
@s3rius
s3rius / Cargo.toml
Last active November 18, 2024 04:38
PyO3-asyncio async streams
[package]
name = "itertest"
version = "0.1.0"
edition = "2021"
[dependencies]
futures = "0.3.28"
pyo3 = "0.19.2"
pyo3-asyncio = { version = "0.19.0", features = ["tokio-runtime"] }
tokio = { version = "1.32.0", features = ["sync"] }
@shirakaba
shirakaba / Creating an Expo app in 2023.md
Created July 12, 2023 08:08
Creating an Expo app in 2023

Creating an Expo app in 2023

12th July, 2023. I'm going to try creating an iOS app called Paranovel, using Expo. My environment for mobile app dev (Xcode, Ruby, etc.) should be in reasonably good shape already as I frequently develop with React Native and NativeScript.

Creating the app

Go to https://docs.expo.dev, and see the Quick Start: npx create-expo-app paranovel

This runs with no problem, then I get this macOS system popup:

@JLarky
JLarky / IsolateCSS.tsx
Last active July 10, 2023 09:23
How to use shadow dom to isolate CSS of React component https://twitter.com/JLarky/status/1657989891526123520
export function IsolateCSS(props: { children: React.ReactNode }) {
const onceRef = useRef(false);
const [shadowRoot, setShadowRoot] = useState<ShadowRoot>();
const ref = useCallback((ref: HTMLDivElement | null) => {
if (ref && onceRef.current === false) {
onceRef.current = true;
setShadowRoot(ref.attachShadow({ mode: 'open' }));
}
}, []);
@kwilcox
kwilcox / intake.py
Created March 1, 2023 20:28
xpublish-intake
import yaml
import logging
from typing import Sequence
from starlette.routing import NoMatchFound
from fastapi import APIRouter, Depends, Response, Request
from xpublish.utils.api import DATASET_ID_ATTR_KEY
from xpublish.plugins import Dependencies, Plugin, hookimpl
@newhouseb
newhouseb / index.ts
Created July 29, 2021 14:13
Rust + AWS Lambda + Pulumi
/*
* Lambda/Web configuration
*/
const robocontrollerRole = new aws.iam.Role("robocontrollerRole", {
assumeRolePolicy: aws.iam.assumeRolePolicyForPrincipal({ Service: "lambda.amazonaws.com" }),
});
const lambdaRole = new aws.iam.RolePolicyAttachment("executeLambdaRoleAttach", {
role: robocontrollerRole,
@shirakaba
shirakaba / README.md
Last active July 1, 2025 08:31
GUI-based debugging of iOS/macOS Rust projects in Xcode

Here's how to get your environment set up to:

  1. Develop iOS and Android apps using Rust.
  2. Enable GUI debugging of Rust projects in Xcode.

If you just want to enable GUI debugging of macOS Rust projects in Xcode, I'm not actually sure whether you need cargo-mobile at all. But one benefit of installing it is that it automatically installs rust-xcode-plugin for you, giving you syntax highlighting of Rust sources in Xcode.

Prerequisites

cargo-mobile

@MegaMaddin
MegaMaddin / react-native+0.64.1.patch
Created May 13, 2021 14:16
[react-native][iOS] Trigger onRequestClose when swiping down a pageSheet
diff --git a/node_modules/react-native/React/Views/RCTModalHostView.h b/node_modules/react-native/React/Views/RCTModalHostView.h
index c54c1c6..a5c49d1 100644
--- a/node_modules/react-native/React/Views/RCTModalHostView.h
+++ b/node_modules/react-native/React/Views/RCTModalHostView.h
@@ -16,7 +16,7 @@
@protocol RCTModalHostViewInteractor;
-@interface RCTModalHostView : UIView <RCTInvalidating>
+@interface RCTModalHostView : UIView <RCTInvalidating, UIAdaptivePresentationControllerDelegate>
@rmg55
rmg55 / Warp_Xarray.ipynb
Last active July 26, 2022 10:21
Wrapping Raster to Xarray+Dask
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.