fperson

joined 1 year ago
MODERATOR OF
[–] fperson 1 points 1 year ago
[–] fperson 2 points 1 year ago

Thanks for sharing! The beginning and the comments look promising; added to WL!

[–] fperson 3 points 1 year ago

Also, if there are any Apple Music users on iOS 17, I'd highly appreciate it if you share the experience. When I first heard the announcement, I thought they were finally adding something like Spotify Connect, but after looking for it, I think it's not the case, unfortunately.

[–] fperson 2 points 1 year ago

and then it's gonna say you need to update Xcode to be compatible with your iOS

(╯°□°)╯︵ ┻━┻

[–] fperson 1 points 1 year ago

You could install an adblocking user script maybe

You can! Ghostery and Adguard are available for Safari. Also, lots of userscripts :)

[–] fperson 3 points 1 year ago

Replied above for a better comment hierarchy. Feel free to comment there if you have any questions/thoughts!

[–] fperson 3 points 1 year ago

It's also worth noting that freezed is switching to the Dart 3 pattern matching, too (see https://pub.dev/packages/freezed#legacy-union-types-and-sealed-classes).

Anyways, I think this is a matter of preference, and I've been historically avoiding codegen as much as possible. I'm glad it's now easier to do that, but freezed is still cool and could be really helpful for certain people/scenarios!

[–] fperson 2 points 1 year ago (2 children)

Since there are too many examples on the freezed README and the one at the top isn't a good use case to begin with (I like to keep my data models (DTOs) separate from entities, and DTOs are good enough with plain json_serializable), I'll provide an example from one of the projects I'm currently working on. It is still more verbose than it would usually be with freezed, however, I'm pretty fine with that. Also, it's worth noting that whenever I need a copyWith, I still use codegen with copy_with_extension. It has a nicer copyWith API and only handles that instead of a bunch of other stuff I don't necessarily need.

part of 'simply_browser_bloc.dart';

sealed class SimplyBrowserState with EquatableMixin {
  const SimplyBrowserState();
}

class SimplyBrowserInitial extends SimplyBrowserState {
  const SimplyBrowserInitial();

  @override
  List<Object?> get props => const [];
}

class SimplyBrowserLoading extends SimplyBrowserState {
  const SimplyBrowserLoading({this.loadedSimplies});

  final List<Simply>? loadedSimplies;

  @override
  List<Object?> get props => const [];
}

class SimplyBrowserFailed extends SimplyBrowserState {
  const SimplyBrowserFailed(this.failure);

  final ApiFailure failure;

  @override
  List<Object?> get props => [failure];
}

class SimplyBrowserLoaded extends SimplyBrowserState {
  const SimplyBrowserLoaded({
    required this.canLoadMore,
    required this.simplies,
  });

  final bool canLoadMore;
  final List<Simply> simplies;

  @override
  List<Object?> get props => [simplies];
}

And then using the sealed class itself becomes super-nice, like the following snippet (only wrapped in a function to state clearly where the variable is coming from):

  List<Simply>? getSimplies(SimplyBrowserState state) {
    return switch (state) {
      SimplyBrowserLoading(:final loadedSimplies) => loadedSimplies,
      SimplyBrowserLoaded(:final simplies) => simplies,
      _ => null,
    };
  }
[–] fperson 5 points 1 year ago

While I do agree with you that spez fucking up like this was, in a way, an excellent thing for the internet, by "failed," he was referring to the mods who went back to Reddit. And it appears that there were lots of them. It's more about giving up so quickly and protesting in a weird way rather than some people starting to migrate to open platforms.


This is still a success for me! I've been a local Armenian Mastodon user for a long time. Then Elon took over Twitter, and many folks I was interested in following migrated to Mastodon, finally making me open up an international/English account there. And now this allowed me to replace Reddit with a federated FOSS, which is super-cool! I'm grateful for that, actually!

[–] fperson 2 points 1 year ago

If you happen to be using macOS and/or iOS, there's the awesome FOSS NetNewsWire!

[–] fperson 3 points 1 year ago

Nice stuff! Wanted to build it earlier today but noticed you're using the latest version of Dart which I didn't have and delayed the whole thing until the next occasion :)

[–] fperson 2 points 1 year ago
2
submitted 1 year ago by fperson to c/rhcp
 

Hey, folks! I hope you're having a lovely day! I'm a big fan of John Frusciante and created [email protected] for people who want to discuss John's music, thoughts, interviews, etc., on Lemmy! Feel free to join!

<3

3
Forever grateful to John! (self.frusciante)
submitted 1 year ago by fperson to c/frusciante
 

I published this picture several months ago in the r/John_Frusciante subreddit, but I think this can be a fitting first post here!

Welcome to [email protected], a sublemmy around the happening of John Frusciante! I hope we'll eventually get to the point where decentralized communities are the thing.

 

[email protected] - a community for all-things electropunk 💥

like a new breath

like a new desire

2
submitted 1 year ago by fperson to c/electropunk
 

Electropunk has a very special place in my heart. I love it in an unusual way. While there are only several bands that are recognized as electropunk, there's lots of other music that feels like it.

I've been recently listening to lots of Bondage Fairies, and I think they are now one of my favorite bands! And Kap Bambino is, of course, superb. Just a random thingie :).

Anyways, feel free to share and discuss everything related to electropunk here!

 

I've been using the new pattern matching from Dart 3 a lot since the release, and I want to share how much better the experience of writing Dart became for me. I completely replaced Freezed with Dart sealed classes, and they're joyful to use too!

I love Dart!

 

Hey, fellas! I've been recently watching lots of South Park and found myself wishing that the official South Park website had some additional features/behaviors for a better viewing experience. So I made a browser extension to fix that.

I myself find it pretty helpful so far! Here's a list of current features:

  • Adds a "Skip Intro" button
  • Automatically hides the cursor after a few seconds of inactivity on the video player
  • Toggle play/pause on click on the video player
  • Always play/pause the video when the spacebar is pressed (instead of scrolling the page if the video is not focused)
  • Configurable seeking time (defaults to 5 seconds)
  • Toggle fullscreen on double-click
  • Makes episodes' list under "Watching" scrollable
  • Focuses the currently selected season when opening the season selection dropdown
  • Makes the "FULL EPISODES" header on the homepage link to the full episodes page.

I was initially planning also to add functionality for marking episodes as watched/unwatched but dunno when I'll get to that.

It's open-source and currently supports Chrome (and any Chromium-based browsers; e.g., Brave, Arc) and Firefox. I may eventually build it for Safari too :)

I hope you find it useful!

P.S. If you have any small improvement ideas, there's a big chance that I'll implement them if you share them!

11
submitted 1 year ago* (last edited 1 year ago) by fperson to c/[email protected]
 

Hey folks! I hope you're having a lovely day. I created a sublemmy for Dart; feel free to join at [email protected]!

Edit: Add relative link

view more: ‹ prev next ›