Ian Irving 🇨🇦 · @iani
121 followers · 531 posts · Server ruby.social

Ruby's Hash is a Swiss-Army Knife

TL;DR: Ruby has a single Hash class to manage key-value pairs. It's a very flexible data structure. It can act as a data object, a dictionary, a hash table, a sorted list, and much more. Like almost everything in Ruby, it's a sharp knife that you can use to cut yourself, but can also use to cook great food; I mean, write good programs.

akshaykhot.com/ruby-hash-is-a-

#ruby

Last updated 1 year ago

svoop · @svoop
2 followers · 36 posts · Server ruby.social

Ever wanted to modify an ENV variable, an instance or class variable for the duration of a block or all tests of a group? This pattern emerged repeatedly in my suites and as I don’t like to bloat my spec helper, about time for the lightweight and dependency-free minitest-substitute gem. Drop cumbersome before and after handling with one or more easy to read `with "ENV['FOO']", "bar"` or `with "@run_at", on: Config { Time.now }` declarations. Happy testing! github.com/svoop/minitest-subs

#ruby #minitest

Last updated 1 year ago

Greg Donald · @gd
97 followers · 887 posts · Server ruby.social

Django has auth/perms/roles builtin, works great. Laravel has auth/perms/roles built-in and is fabulous. Spring Boot, Catalyst, similar deals.

Rails has nothing built-in, so a lot of us end up using a 3rd-party POS called Devise that is broken for months at a time blocking other important gem dependency updates. And don't even get me started on those fugly ERB templates.

Is there still nothing better? I DuckDuckGo'd but kept ending up on Devise 😩

#ruby #rails

Last updated 1 year ago

Paul Keen · @pftg
1 followers · 7 posts · Server ruby.social

What is the ideal design for a REST API client that you would prefer to follow for your new API clients?

Please select or suggest from the list the closest!

#ruby #crystal #api #helpwanted

Last updated 1 year ago

Jason Gaylord · @jasongaylord
29 followers · 74 posts · Server techhub.social

I just released v1.3.7 of the Jekyll theme called SpaacedOut. Check out the details at jasong.us/3sE4dQU.

#jekyll #jekylltheme #cms #css #dev #webtheme #webthemes #spaacedout #ruby #gem

Last updated 1 year ago

masukomi · @masukomi
372 followers · 6678 posts · Server connectified.com

Just a General FYI for users of
I believe there is a bug in Mongoid 4.15 that breaks expectations of querying has_and_belongs_to_many relationships. Ticket here:

jira.mongodb.org/browse/MONGOI

#ruby #mongoid #mongodb

Last updated 1 year ago

Amir Rajan · @amirrajan
562 followers · 916 posts · Server ruby.social

Bomb mechanics and enemies in a metroidvania I'm working on. Made with DragonRuby Game Toolkit. youtu.be/J7hXDCxc_W0

#ruby #gamedev

Last updated 1 year ago

space monster boyfriend · @itspomf
38 followers · 3286 posts · Server chitter.xyz

Well, managed to fix one issue by dealing with a horrible anti-pattern with refinements.

Unfortunately, I've got another scoping problem that I can't quite tease apart, nor can I diagnose it, since the default gem "did_you_mean" is causing segmentation faults when I try to trace the error! Isn't that fun.

#ruby

Last updated 1 year ago

adarsh 🚲 · @adarsh
625 followers · 206 posts · Server ruby.social

I’ve become a co-maintainer of rubyconferences.org.

My first order of business was to link out to this awesome iCal feed.

#ruby #conferences

Last updated 1 year ago

Tim Riley · @timriley
1071 followers · 526 posts · Server ruby.social

Here’s my open source status update for August, in which we get a couple of chonker PRs merged, setting us up for our downhill run towards finishing assets support, also now tracked in a handy dandy GitHub proejct.

timriley.info/writing/2023/09/

#ruby #oss #hanami

Last updated 1 year ago

Vidar Hokstad / Galaxy Bound · @vidar
474 followers · 1613 posts · Server m.galaxybound.com

Ok, I'm going to stop with the screenshots for a while now (sorry for the bombardment), but just quite pleased with this:

All the application code showcased in this picture is pure other than Xorg and the window manager (hmpff...).

* The terminal
* The shell (by Geir Isene)
* The desktop / file manager
* The text editor...

Including:
* The font renderer
* The X11 client code.

The terminal and shell are not 100% my daily drivers yet - they need a few more fixes first, but close.

#ruby

Last updated 1 year ago

Vidar Hokstad / Galaxy Bound · @vidar
473 followers · 1607 posts · Server m.galaxybound.com

Okay, it's now officially my new file manager. It has next to *no* functionality. No scrollbars yet, no dragging files, no actions other than clicking on them, but it opens folders and opens (some) stuff based on mime type. It's "enough" for my very limited use.

I really need to commit these X11 bindings and this code as well soon.

#ruby

Last updated 1 year ago

Vidar Hokstad / Galaxy Bound · @vidar
472 followers · 1598 posts · Server m.galaxybound.com

Does this officially make me a proper zealot?

(No, it's not functional yet; yes it is a pure Ruby program rendering my desktop icons via the raw X protocol, and using the pure-Ruby ChunkyPNG to load the icons)

#ruby

Last updated 1 year ago

postmodern · @postmodern
1351 followers · 2100 posts · Server ruby.social

I'm curious what is the most elegant way in Ruby to create a scale of Symbol values (high, medium, low, etc) such that you can compare Symbols and filter objects that have a value less than a specific value on the scale?

The least elegant way is to map the Symbols to Integer values and filter/select based on:

SCALE = {low: 0, medium: 1, high: 2, ...}

objs.select do |obj|
SCALE[obj.severity] < SCALE[:high]
end

#ruby

Last updated 1 year ago

Vidar Hokstad / Galaxy Bound · @vidar
472 followers · 1597 posts · Server m.galaxybound.com

Testing double-width and double-height support in my Ruby terminal (left), xterm (middle), and st (right).

My support isn't *correct* yet - if you just use the escapes for one half the clipping is broken, but still - most terminals doesn't even try, which is a shame because it's an easy addition.

#ruby

Last updated 1 year ago

Pito Salas · @Pitosalas
54 followers · 354 posts · Server ruby.social

Link blog entry for "Let's Implement the Map Method from First Principles": Those new to functional programming often wonder when to use higher-order functions (or blocks/procs/lambdas in Ruby). I did, too. In this post, we'll implement the map method from scratch, in turn gaining an intuitive understanding of higher-order functions and when to use them. (akshaykhot.com/map-from-first-)
, explainer, proc, lambda, map

#ruby

Last updated 1 year ago

MAU · @Mau_or_
335 followers · 4803 posts · Server mastodon.bida.im


Un Paese impegnato da giorni a dibattere sulle parole allucinanti di , compagno di , e quindi difese a spada tratta a destra, dove nessunə ha un sussulto di dignità, come già successo per " nipote di ".
La politica in Italia (e si potrebbe allargare il discorso all' informazione).

#buongiorno #Giambruno #meloni #ruby #mubarak #9settembre

Last updated 1 year ago

Hacker News 50 · @hn50
3530 followers · 72704 posts · Server social.lansky.name

#ruby

Last updated 1 year ago

olivierlacan · @olivierlacan
885 followers · 1692 posts · Server ruby.social

👋 If you know folks looking for help on Ruby/Rails projects, I'm available for freelance work right now.

Old app rescues, big upgrades, feature work, you name it, I either truly enjoy doing it or reluctantly became good at it over the years, and now here we are.

I can also do some pretty nifty DIY heat pump installs and home espresso setups but that'll take a bit longer. 😅

DM or hi@olivierlacan.com to discuss.

PS: double points if you work on climate or science-related work

#ruby #rails

Last updated 1 year ago

James :ruby: · @floehopper
167 followers · 471 posts · Server ruby.social

@jsrn I did some work a while ago using a combination of the ‘parser’ and ‘rugged’ gems to trace the git history of a method which might be relevant.

I wrote a couple of blog posts about it and the code is open-source:

* gofreerange.com/tracing-the-gi
* gofreerange.com/building-a-git
* github.com/freerange/method_lo

#ruby

Last updated 1 year ago