Skip to content

Instantly share code, notes, and snippets.

View csells's full-sized avatar

Chris Sells csells

View GitHub Profile
@csells
csells / vs-code-pi-action-button.md
Last active February 23, 2026 03:04
Create an Action Button in VSCode to start a session of the pi coding agent in a new terminal window in the editor area

🚀 Auto-Setup: "Run Pi" VS Code Macro Button & Shortcut

This prompt is designed for AI coding agents (like Cursor, GitHub Copilot Chat, or an autonomous CLI agent).

By feeding this prompt to your AI assistant, it will automatically configure VS Code to add a custom macro that:

  1. Opens a new terminal natively within the Editor Area (rather than the bottom panel).
  2. Instantly executes the pi CLI command.

To make this easily accessible, the agent will map the macro to both a keyboard shortcut (Ctrl+Alt+P) and a clickable UI button on your VS Code Status Bar.

@csells
csells / main.dart
Created November 21, 2025 02:58
sketchy material hijack
import 'dart:math';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
// While Dart's int on the web can go up to 2^53 (MAX_SAFE_INTEGER),
// Random.nextInt() has a limitation of 2^32 on both VM and Web.
const int _kMaxSeed = 0xFFFFFFFF;
@csells
csells / main.dart
Last active January 29, 2025 20:01
Flutter snake game with keyboard bindings
import 'dart:async';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
final lightTheme = ThemeData(colorSchemeSeed: Colors.orange, …);
final darkTheme = ThemeData(colorSchemeSeed: Colors.orange, brightness: Brightness.dark, …);
final lightScheme = ColorScheme.fromSeed(seedColor: Colors.green);
final darkScheme = ColorScheme.fromSeed(seedColor: Colors.green, brightness: Brightness.dark);
personsRef.whereName(isEqualTo: 'Bob');
personsRef.whereAge(isGreaterThan: 42);
@JsonSerializable()
class Person {
Person({required this.name, required this.age});
final String name;
final int age;
}
@Collection<Person>(‘/persons’)
final personsRef = PersonCollectionReference();
class FirestoreTableStory extends StatelessWidget {
FirestoreTableStory({Key? key}) : super(key: key);
// live Firestore query
final usersCollection = FirebaseFirestore.instance.collection('users');
@override
Widget build(BuildContext context) {
return FirestoreDataTable(
query: usersCollection,
class UserListView extends StatelessWidget {
UserListView({Key? key}) : super(key: key);
// live Firestore query
final usersCollection = FirebaseFirestore.instance.collection('users');
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: const Text('Contacts')),
body: FirestoreListView<Map>(
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutterfire_ui/auth.dart';
import 'firebase_options.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
runApp(MyApp());