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

KyleHunter
What is a good language for beginners to make apps like snapchat and instagram?
New
AstonJ
Which apps do you think are killing it right now? Either from a technical perspective or ones that you like personally or feel have been...
New
chasekaylee
Just like the title says :smiley: which courses you find that have had the most impact in the span of your career as a developer?
New
AstonJ
Inspired by this tweet by @dasdom Even if you take out all the damage being done by humans, our planet has about 50B years before bein...
New
mjk
TL;DR: words that incorporate negation are acceptable, eg. independent, asymmetric, nondeterministic. An example in the book is to renam...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
New
DevotionGeo
The Odin programming language is designed with the intent of creating an alternative to C with the following goals: simplicity high per...
New
DevotionGeo
I hate having mandatory semicolons in a language, no matter how beautiful the language is otherwise. What about you?
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1139 25478 754
New

Other popular topics Top

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
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
New