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

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
justinjunodev
Figured this would be a cool topic and maybe provide some inspiration for those who are just starting to work from home. Feel free to sha...
New
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
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
chasekaylee
Hi everyone! I have been in the professional industry for ~2 years now coming from a boot camp. I started a base foundation by programmin...
New
jaywengrow
Hello! It’s Jay Wengrow, author of A Common-Sense Guide to Data Structures and Algorithms. My book now has a supplemental website, where ...
New
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
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
AstonJ
Chris Seaton, the creator of TruffleRuby has died. It appears from suicide :cry: He left this note on Twitter on the weekend: And one...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New