Skip to content

Instantly share code, notes, and snippets.

View lunacookies's full-sized avatar

Luna Razzaghipour lunacookies

View GitHub Profile
@lunacookies
lunacookies / Entry Point.m
Created May 7, 2025 06:39
Combining view controller lifecycle methods and window occlusion notifications to pause invisible work
@import AppKit;
@import os.log;
@interface MainViewController : NSViewController
@end
@implementation MainViewController {
NSTextField *_label;
id<NSObject> _occlusionObserver;
NSTimer *_timer;
@lunacookies
lunacookies / AppDelegate.m
Created March 19, 2025 01:57
AppKit programmatic main menu
@implementation AppDelegate
- (instancetype)init {
self = [super init];
NSString *displayName = [NSBundle.mainBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"];
NSMenu *mainMenu = [[NSMenu alloc] initWithTitle:@"Main Menu"];
{
@lunacookies
lunacookies / syntax_ideas.md
Last active May 7, 2020 01:37
Some Syntax Ideas

What is this?

I’m working on a new language (Fjord) for a shell (fj). Although I have some ideas of my own for syntax, I’m not sure if they’re a really bad idea or if they’re fine, so I’ve decided to conduct a ‘sanity check’ of sorts by writing some preliminary ideas down here. Please respond down in the comments with any thoughts you have!

General philosophy

Note: throughout this document I’ll refer to functions, which are what I’m calling commands.

As this is a language for a shell,

An Idea I Had On Shells

Hi, everyone! I recently found out about the performance benefits of keeping things (specifically command-line utilities) in one binary (groundbreaking, I know), and thought they might have some interesting applications in shell development. Don’t expect anything amazing or not-rambling though -- my ideas are not very well-formed at the moment.

GNU’s find and grep

Let’s say you are looking for {files,directories} that are named rust. Well, you might start with getting an overview of what you’re dealing with:

$ find .