DevotionGeo

DevotionGeo

Tips and Tricks (Today I learned)

In this thread you can add any type of tips and tricks. Any feature of some language, framework, terminal, code-editor, the operating system you use, social media platform you use, or even the devtalk. Thing which you just learned, but you wish that you knew it earlier.

(You’re welcome to edit the intro).

Most Liked

ohm

ohm

You can run ri from inside IRB if you do this:

def ri(*args)
  RDoc::RI::Driver.run(args)
end

Now you can do

> ri 'String.length'

AntonRich

AntonRich

So today I learned, sort of by accident, how to wrap any number of strokes into their separate li html elements.

I use Sublime editor. In there I pressed Ctrl+Shift+p (command pallete) and typed ‘wrap’ and found Emmet’s ‘Wrap with Abbreviation’ function.

At first I just tried ul>li*5. That wasn’t what I wanted. I just thought how could I get to the result I wanted when I started backspacing and when 5 was removed I was left with **ul>li * ** it worked. Good think I noticed. Saved some precious time on googling that stuff.

Gosh, I got so excited.

DevotionGeo

DevotionGeo

While you cannot run ri commands from inside an irb session, you can run ri commands from inside a pry session.

What are ri, irb and pry?

ri:
I have seen different (very talented) people saying that it’s abbreviated from different terms, like Ruby Information, Ruby Interactive and Ruby Index. No matter which term it stands for, it’s the Ruby tool for navigating documentation.

irb:
Interactive Ruby Shell is a REPL for Ruby.

pry:
A runtime developer console and IRB alternative with powerful introspection capabilities (as stated on its Github page). Installable as a Gem.


Where Next?

Popular General Dev topics Top

Rainer
Have you seen the new features that will be available in the upcoming C# 9 release? C# is taking a lot of input from functional l...
New
wolf4earth
Inspired by this thread about arcade games - which I initially misread as favorite arcade game soundtracks - I wanted to ask about your f...
New
AstonJ
In your opinion which programming languages are simple to use and easy to get started wither those who don’t have a computer science bac...
New
AstonJ
:smiling_imp: What is your preferred syntax style and why? Perhaps we can add examples and use the code below as a simple reference poi...
New
AstonJ
Thought it might be worth having a dedicated thread for standing desk treadmills (for those interested, here’s our general thread on stan...
New
DevotionGeo
As the title suggests, this thread will contain some real wisdom came from experience. Please add something meaningful than fancy looking...
New
finner
One of my 2021 resolutions is to read more tech books. As part of this effort I purchased two MEAPs (Manning Early Access Program) which...
New
OvermindDL1
What shell(s) do you use, why do you use them, and how do you have them configured? Note, this is about shell’s, not terminals, terminal...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
ivanhercaz
Hi! I usually keep changelogs for my projects because I think they are really useful, not only to track the changes and not to be lost b...
New

Other popular topics Top

malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New