Skip to content

Instantly share code, notes, and snippets.

View airstrike's full-sized avatar
🦀
0-to-1 founder building with Rust + AI

Andy Terra airstrike

🦀
0-to-1 founder building with Rust + AI
View GitHub Profile
@airstrike
airstrike / main.rs
Last active October 27, 2025 15:39
Multi-window iced example with custom theme palette
// iced.version = "0.13" # iirc
use std::collections::BTreeMap;
use std::time::Duration;
use iced::theme::Palette;
use iced::widget::{button, center, container, horizontal_space, row, text};
use iced::{time, window, Center, Element, Fill, Subscription, Task, Theme};
struct App {
windows: BTreeMap<window::Id, Window>,
@airstrike
airstrike / mute-mic.ahk
Last active October 12, 2025 01:07
AutoHotkey | Toggle microphone hotkey script (Windows+U)
;
; AutoHotkey Version: v1.1.22.06
; Language: English
; Platform: Windows 10
; Author: Andy Terra <github.com/airstrike>
;
; Script Function:
; Toggle Microphone Mute -- assumes it is located at WAVE:1, device #2
; Use the SoundCardAnalysis script to figure out where your mic is
; https://www.autohotkey.com/docs/commands/SoundSet.htm#Ex
@airstrike
airstrike / now_playing.rs
Created June 30, 2025 01:43
iced • now playing: chill tracks only
use rand::Rng;
use iced::time::{Duration, Instant};
use iced::widget::canvas::{Frame, Geometry, Path, Program};
use iced::widget::{button, canvas, center, column, text};
use iced::{Element, Point, Rectangle, Renderer, Size, Theme};
use iced::{Fill, Subscription, Task};
const NUM_BARS: usize = 20;
const MAX_BAR_HEIGHT: f32 = 0.7;
@airstrike
airstrike / split.rs
Last active March 30, 2025 13:08
`Split` widget for `iced`
//! Divide the available space in two parts to display two different elements.
//
// Originally from iced_aw. https://github.com/iced-rs/iced_aw/
//
// Kept up-to-date with `iced`'s `master` branch by me (`0.14.0-dev`).
//
// New features:
// - Negative divider position, for measuring from the end (right or bottom)
// MIT License
@airstrike
airstrike / logger.rs
Last active February 23, 2025 20:12
Sample simple logging with tracing
use std::{fs::File, sync::Arc};
use tracing::Level;
use tracing_subscriber::{
filter::{LevelFilter, Targets},
fmt,
prelude::*,
};
pub use tracing::{debug, error, info, trace, warn};
@airstrike
airstrike / .vimrc
Created February 22, 2025 21:50
latest .vimrc (works in vim and VSCode)
" VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set 7 lines to the curors - when moving vertical..
set so=4
set ruler "Always show current position
set cmdheight=1 "The commandbar height
" Set backspace config
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
@airstrike
airstrike / window.rs
Created February 7, 2025 01:23
iced::daemon with only two windows
use std::collections::BTreeMap;
use iced::advanced::graphics::image::image_rs::ImageFormat;
use iced::{window, Size, Subscription, Task, Element};
use crate::theme::constants::WINDOW_ICON;
use crate::theme::Theme;
use crate::{app, assistant};
#[derive(Debug)]
pub enum Message {
@airstrike
airstrike / font_sampler.rs
Created January 31, 2025 02:43
iced font sampler
use iced::Alignment::Center;
use iced::Length::Fill;
use iced::font::{self, Font};
use iced::widget::{column, horizontal_rule, pick_list, row, scrollable, text, text_input};
use iced::{Element, Size, Task};
use std::collections::HashMap;
// Font candidates with their names and possible paths
const FONT_CANDIDATES: &[(&str, &[&str])] = &[
("Menlo", &[
@airstrike
airstrike / QualityHuntComponent.tsx
Created January 15, 2025 19:52
A React component for a curated product launch platform that focuses on quality over quantity. Features a daily showcase carousel, ranked submissions, and a clean, minimalist design. Built with React and Tailwind CSS.
import React, { useState } from 'react';
import { Clock, ArrowUp, MessageSquare, ChevronLeft, ChevronRight, Search, ExternalLink } from 'lucide-react';
const LaunchPlatform = () => {
const [currentSlide, setCurrentSlide] = useState(0);
const todaysLaunches = [
{
id: 1,
name: "CodePilot Pro",
@airstrike
airstrike / markdown.rs
Created January 10, 2025 20:05
A variation of iced's markdown widget which includes a "copy" button for codeblocks
use iced::widget::{button, column, container, hover, rich_text, row, scrollable, text, Button};
use iced::widget::{horizontal_space, markdown};
use iced::{padding, Element, Font, Length, Pixels};
pub use iced::widget::markdown::{HeadingLevel, Item, Settings, Style, Url};
/// Display a bunch of Markdown items with copy functionality for code blocks.
pub fn view<'a, Message, Theme, Renderer>(
items: impl IntoIterator<Item = &'a Item>,
settings: Settings,