Skip to content

Instantly share code, notes, and snippets.

View sethladd's full-sized avatar

Seth Ladd sethladd

View GitHub Profile
### **Prompt for Generating Dart Code with Dot Shorthands**
**Directive for Code Generation:**
You are a coding agent that generates Dart code. When creating new code for a project using Flutter version 3.27 or higher (Dart SDK >= 3.10), you must use the **dot shorthands** feature wherever context allows. This is the modern, preferred syntax.
**The Dot Shorthand Feature:**
Dot shorthands (`.member`) are a concise way to access static members, enum values, and constructors when the receiver's type can be inferred by the compiler.
#!/bin/bash
# Default start and end dates
DEFAULT_START_DATE="2025-01-01"
DEFAULT_END_DATE="2025-05-21"
# Initialize variables with default values
START_DATE="$DEFAULT_START_DATE"
END_DATE="$DEFAULT_END_DATE"
DISPLAY_EMAILS=false
// Vibe coded in DartPad w/ Gemini on May 15 2025
// I wanted to create this effect as I've always liked it.
// Enjoy!
import 'package:flutter/material.dart';
import 'dart:math' as math;
void main() {
runApp(const MyApp());
}
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@sethladd
sethladd / not_serious.dart
Created April 27, 2025 21:10
performance art
import 'package:flutter/material.dart'; // Or wherever ActionStateType comes from
// --- State Pattern Implementation ---
// 0. Define the result type (e.g., an enum) if needed for UI logic
enum ActionStateType { ready, answering, complete }
// 1. Define the State Interface (or abstract class)
abstract class GameState {
// Method for the state to determine what the *current* state should be
#!/bin/bash
# Script to automate Flutter SDK installation and setup for iOS development on macOS.
# Corrected URL finding logic for Intel vs Arm. V1.5
# --- Configuration ---
FLUTTER_INSTALL_PARENT_DIR="${HOME}/development" # Default parent directory for Flutter SDK FOLDER
FLUTTER_DOCS_URL="https://docs.flutter.dev/get-started/install/macos/mobile-ios"
SCRIPT_VERSION="1.5" # Updated Version
REPORT_FILE="/tmp/flutter_setup_report_$(date +%s).txt"
@sethladd
sethladd / another case.dart
Last active February 3, 2025 05:44
Wild ideas
//Before:
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Stepper'),
),
body: Stepper(
steps: widget.steps,
currentStep: widget.currentStep,
Center()
<| DecoratedBox(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.grey.withValues(alpha: 0.5),
offset: Offset(3, 3)
)
@sethladd
sethladd / check_wordpress_blogger_links.rb
Created March 10, 2010 06:47
Migrate from Wordpress to Blogger
@sethladd
sethladd / app.dart
Created February 2, 2012 05:39
Web Audio API and Dart
#import('dart:dom', prefix:'dom');
#import('dart:html');
main() {
dom.AudioContext audioContext = new dom.AudioContext();
dom.AudioBufferSourceNode source = audioContext.createBufferSource();
dom.AudioGainNode gainNode = audioContext.createGainNode();
source.connect(gainNode, 0, 0);