Advertisement ยท 728 ร— 90

Posts by Simon James

Does anyone know of a small exemplar Rails app (<<10 models/controllers) written in Rails 8 using all the defaults? #rails

6 months ago 1 0 1 0

Here's another one for you, a regex that will match almost any ruby string: github.com/mwnciau/rbla...

6 months ago 0 0 0 0

Yeah, you're right. I think it would've been much clearer to extract out to a constant, but the /o modifier allows in-place optimisation so that's what I did because it was easier!

8 months ago 1 0 1 0
Preview
rblade/lib/rblade/compiler/tokenizes_statements.rb at a6148dbac190a1259791e6a225b3f523df0e0a0a ยท mwnciau/rblade A simple, yet powerful templating engine for Ruby on Rails, inspired by Laravel Blade. - mwnciau/rblade

The use case for /o is when you're interpolating (constant) regex objects inside other objects. It lets you split out sub-expressions, increasing readability, without a significant performance hit.

github.com/mwnciau/rbla...

8 months ago 0 0 1 0

The RubyMine plugin might still be a bit rough and ready. Let me know if you have any issues with it.

8 months ago 1 0 0 0
Preview
GitHub - mwnciau/rblade: A simple, yet powerful templating engine for Ruby on Rails, inspired by Laravel Blade. A simple, yet powerful templating engine for Ruby on Rails, inspired by Laravel Blade. - mwnciau/rblade

Really interested in your vision for Herb, particular level 6. You seem to have gone through a similar journey to me, taking inspiration from Heex, whereas I took inspiration from Laravel when I made RBlade: github.com/mwnciau/rblade

There's for sure lots of room for improving templates in Rails.

9 months ago 1 0 1 0
Preview
GitHub - mwnciau/herb-lsp-intellij: This Intellij plugin is a simple wrapper around https://github.com/marcoroth/herb This Intellij plugin is a simple wrapper around https://github.com/marcoroth/herb - mwnciau/herb-lsp-intellij

LSPs seem an order of magnitude easier to implement than adding a templating language natively! I was warned away from trying it. I had a crack: github.com/mwnciau/herb... / plugins.jetbrains.com/plugin/27954...

Happy to hand over/take these down if you'd prefer to keep control over IDE plugins.

9 months ago 1 0 2 0

@marcoroth.dev I think I saw you were making a RubyMine plugin for Herb? How's that going (I've done a bit of JetBrains plugin dev and it can be pretty awful!)

9 months ago 1 0 1 0
Preview
Playground

Here's a simplified example of what I mean in PHP. Defining the shape of hashes can add a lot of safety when working with JSON, for example.

phpstan.org/r/d1c6ccf3-e...

10 months ago 0 0 0 0

I recently read "Division by Zero" by Ted Chiang, a short story about an inconsistent mathematical system. You might might like it.

10 months ago 3 0 1 0
Advertisement

@emilysamp.dev Great talk this morning! I'm excited about the new inline RBS syntax of sorbet. I heard it may not be feature complete compared to sorbet's sig? Is adding hash keys to types on the roadmap at all?

10 months ago 0 0 1 0

@rosa.codes Great talk this morning! I was very impressed at how clearly you explained everything in such a short time. This mathematician approves ๐Ÿ˜„ Have you ever tinkered with Haskell (or even elixir/phoenix)?

10 months ago 1 0 2 0

@andycroll.bsky.social Nice font! Are those ligatures?

10 months ago 0 0 1 0

I'd not come across either, but I can see the similarities. The idea came from Laravel's data_get and data_set methods, which I've used in the past.

11 months ago 1 0 0 0
Post image

I've found myself needing to create simple interfaces for complicated data structures in Ruby recently.

I've just released a small, self-contained gem for interacting with nested data structures using dot-delimited keys:

github.com/mwnciau/dotkey #ruby

11 months ago 5 2 1 0

True, false or error?

"% == %%%"

#ruby

1 year ago 2 0 0 0
Preview
GitHub - mwnciau/rblade: A simple, yet powerful templating engine for Ruby on Rails, inspired by Laravel Blade. A simple, yet powerful templating engine for Ruby on Rails, inspired by Laravel Blade. - mwnciau/rblade

Just released RBlade 3.0, a performant component-based templating library for Rails. Now with dynamic components and options to integrate into ERB and other templating languages. github.com/mwnciau/rblade #rails #rubyonrails #ruby

1 year ago 1 0 0 0

Looking to add type signatures to my #RubyOnRails app - to improve editor suggestions and possible add steep. Any suggestions/experiences? Considering going for a Yard + Sord approach.

1 year ago 2 0 0 0

I find the string freeze/unfreeze modifiers a little surprising. +"0" and -"0" give very different results in some other languages!

1 year ago 0 0 1 0