Skip to content

Instantly share code, notes, and snippets.

@bbasata
bbasata / hello-ruby.md
Created November 6, 2017 21:44
Hello Ruby
  1. Programming Ruby: the classic “pick-axe” book. it’s a tome — i haven’t read it cover-to-cover. i think it’s useful for the first few chapters & then coming back to it as a reference when i need to get more in-depth on a topic: https://pragprog.com/book/ruby4/programming-ruby-1-9-2-0 — i’m a bit surprised that it seems not to have been updated for Ruby 2.1, 2.2, 2.3, or 2.4 :)

  2. Ruby Koans: I found this really useful for getting over the initial learning curve with Ruby. Fun and approachable. http://rubykoans.com/ — I think this is also a bit dated, though likely still great for fundamentals

  3. Michael Hartl’s Ruby on Rails Tutorial helped me get over the initial learning curve with Rails.

  4. Learn Ruby the Hard Way — I have not read this one. It’s the newest learning-Ruby book that I know of, and I generally have a positive opinion of Zed Shaw’s “* the Hard Way” series.

I would recommend #4 and maybe #2 to someone starting with Ruby. #3 if you want to make sense of Rails. #1 as a reference, tho

When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

package main
import (
"fmt"
"unsafe"
)
func main() {
fmt.Println("Sizeof(Variant{}) =", unsafe.Sizeof(Variant{}), "bytes")
for item := range items {
package main
import (
"fmt"
"example.org/int/typ"
)
func main() {
for item := range items {
package main
import (
"fmt"
"example.org/int/typ"
)
func main() {
for item := range items {
package main
import (
"fmt"
"iter"
"slices"
"strconv"
"example.org/int/typ"
)