Skip to content

Instantly share code, notes, and snippets.

View Cretezy's full-sized avatar

Cretezy

View GitHub Profile

Auto-copy files when creating Git worktrees or Jujutsu workspaces

The problem

Worktrees and workspaces are one of the best ways to work across multiple branches simultaneously — and they're especially powerful when pairing with AI coding tools like Claude Code or Cursor, where you might spin up a fresh workspace per task or conversation to keep things isolated and clean.

The friction point: ignored files don't carry over. Your .env, .env.local, API keys, local config — none of it comes with you. Every new worktree means manually hunting down and copying those files before you can actually get to work.

The solution: .worktree-copy

@Cretezy
Cretezy / idType.ts
Last active February 23, 2026 23:51
ID Type in TypeScript
// -- Usage
// Declare ID
export const exampleIdUtils = createId("example")
export type ExampleId = ReturnType<typeof exampleIdUtils["generate"]>
// Generate IDs
const generatedExampleId = exampleIdUtils.generate() // Type: ExampleId
// Turn strings to IDs safely, convert them back to string transparently
class SerializerTest:
const _NATIVE_SERIALIZABLE_TYPES = [
TYPE_VECTOR2,
TYPE_VECTOR2I,
TYPE_VECTOR3,
TYPE_VECTOR3I,
TYPE_VECTOR4,
TYPE_VECTOR4I,
TYPE_RECT2,
TYPE_RECT2I,
@Cretezy
Cretezy / nvim-recent.lua
Last active May 11, 2024 05:02
Quick recent file picker in Neovim/Telescope
return {
{
"mollerhoj/telescope-recent-files.nvim",
config = function() require("telescope").load_extension("recent-files") end,
keys = {
{
"<Tab>",
function()
require("telescope").extensions["recent-files"].recent_files({
attach_mappings = function(_, map)

Timeline

  1. Pre-development
    1. Agree on featureset
    2. Designs
    3. Pick tech stack ([see below](#Tech stack))
  2. Development
  3. Release
    1. Link from astronvim.com / AstroCommunity repo

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all of Charles-William Crete's open source projects.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with Charles-William Crete, contributors or maintainers.

1. Grant of Copyright License.

void main() {
// Create the store
final store = Store();
// Register modules
CounterModule(store);
AuthModule(store);
// Provide store to whole application
runApp(StoreProvider(
class LoginScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Login"),
),
body: Center(
// Login button
import 'package:flutter_super_state/flutter_super_state.dart';
import 'package:state_test/src/store/counter.dart';
class AuthModule extends StoreModule {
int get isLoggedIn => isLoggedIn;
var _isLoggedIn = false;
AuthModule(Store store) : super(store);
Future<void> login() async {
import 'package:flutter_super_state/flutter_super_state.dart';
final store = Store();
// Register modules. Order does not matter. You should register all modules on initialization
CounterModule(store);