Where Are My (Ruby) Gems ?

As I mentioned earlier, I’m trying Lunar nvim starter kit. Latest version of nvim comes with LSP support, and while learning a new language LSP could be really helpful (I think) I had heard of solargraph. Running :LspInstall in nvim gave me option of sorbet as well. But I decided to stick with solargraph. nvim was successful in installing solargraph, or so it told me. But it did not work. LspInfo told me that it did not find solargraph Just to be sure I gem install solargraph from the terminal, before I tried to install LSP from nvim again

Continue Reading »

Lunar Nvim

I came across some starter kits for nvim. Earlier I tried adding individual plugins and learning all the nvim basics, but since I’m pretty happy with Doom Emacs 1 But Lunar nvim seems stable and provides a lot of functionality out of the box. 👍 prerequisite page asks to ensure that I have cargo. I knew it a package manager(?) for rust, but didn’t know whether I could install it standalone.

Continue Reading »

Exploring `irb`

Start clean I created an alias irb=irb --sample-book-mode This removes the complex prompt like irb(main):001:0> and gives plain and simple >> instead. Get Help! When programming in Python, even today I use dir in Python REPL. So I was looking for the equivalent in Ruby land. Turns out I was comparing apples and oranges (so to speak) As of early 2022, irb has awesome help built-in. It has good autocompletion. So just typing .

Continue Reading »

Now I have Email Address on my own domain

I have owned this domain for a couple of years now (maybe more) But it never occurred to me to have my email address on that domain. I suppose I always assumed that it would involve setting up own servers and/or cost of server etc. Usually domain registrars provide some free emails, but their interface is just usable. Also, it might become one-more-email I’ll forget to check 😆 But for my recent secret 🕵 project, I needed a professional email.

Continue Reading »

Fish function to read webpage in Terminal

I’m really digging reading web posts in the terminal. After using it for some time, I realized that typing same arguments after the URL (That I usually copied to the clipboard from some other place) is getting cumbersome. So I created a fish function out of it (If you see yourself doing the same task over and over, it is a good place to automated it) Here is the simple function

Continue Reading »

IRC

I could not believe myself, that I finally created an IRC account. Lot of people have asked how come I am not on IRC. They told me that we get to interact with smart people on IRC, including creators of great software, libraries, framework. But for some reason, I resisted. It felt complex, compared to modern communities like Telegram, Discord etc. Today someone suggested it again on the Doom Emacs Telegram channel, and this time I decided to give an honest try.

Continue Reading »

Ruby for Python Programmers

While I noted similarities and difference between Ruby and Python, as I was learning the basics here, here and here there is official document on the Ruby site. See this

Learning Ruby: Syntax (Part 3)

Methods Ruby functions start with def just like python, but end with end keyword. splat operator (*) to destructure an array into a List. This is similar to Python splat operator >>> x = [10, 20, 30] >>> a, *b = x >>> print(f'{a=}, {b=}') a=10, b=[20, 30] Python ☝️, Ruby 👇 >> first, *rest, last = ["a", "b", "c", "d"] => ["a", "b", "c", "d"] >> first => "a" >> rest => ["b", "c"] >> last => "d" >> But in Ruby, splat operator can also create an array.

Continue Reading »

Icons in Directory Listing

Would you like to see pretty icons in your terminal for directory list ? Then install lsd from here Check this pretty screenshot of lsd --tree In case you are wondering, I’m using nord theme with Alacritty

Learning Ruby: Syntax (Part 2)

Learning continues … idiomatic(?) ruby loops use each like : (1..5).each do |counter| puts "iteration #{counter}" end Although python like loop also work for counter in 1..5 puts "iteration #{counter}" end array.each_with_index is like python’s enumerate Ruby seems to have multiple ways to do the same thing, as opposed to Python’s There should be one– and preferably only one –obvious way to do it. e.g. a.map do .. end, a.map { |el| e.

Continue Reading »