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
The obligatory speed test thread :smiley: Check here: https://www.speedtest.net When complete, click on the share link and copy and pas...
New
andresriveros
I am currently subscribed to: The Ruby Rogues Remote Ruby Maintainable Planet Argon founder and ohmyzsh creator. https://maintainab...
New
AstonJ
If you could work on any project, what would it be? :upside_down_face:
New
mjk
TL;DR: words that incorporate negation are acceptable, eg. independent, asymmetric, nondeterministic. An example in the book is to renam...
New
AstonJ
It’s great to see how popular some of these channels have become - do you have any favourite YouTuber devs? Ben Awad Code...
New
AstonJ
Do you think it’s worth worrying about? Do you think it’s going to be an even bigger issue in future? If so what can the teams of smaller...
New
DevotionGeo
I hate having mandatory semicolons in a language, no matter how beautiful the language is otherwise. What about you?
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
New
DevotionGeo
For me it’s six to seven steps above complete dark, on MacBook Air M1.
New

Other popular topics Top

siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
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
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
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
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
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