Skip to content

Commit

Permalink
Notes/tech/coding/ruby.md
Browse files Browse the repository at this point in the history
Notes/templates/dairy.md
  • Loading branch information
dvogt23 committed Mar 19, 2024
1 parent b5bdf03 commit 529ed57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Notes/tech/coding/ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ On arch you have to install openssl-1.0 and run:
PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig:/usr/lib/pkgconfig rvm install <ruby-version>
```

### Merge hashes
```ruby
# Turn a collection of hashes into a single one

{ "yellow" => "#FFBEOB" },
{ "orange" => "#FB5607" },
{ "pink" => "#FF006E" }
1. reduce ({},:merge)

#=>“"yellow"=>"#FFBEOB", "orange"=>"#FB5607", "pink"=>"#FF006E"}
{}.merge(hash1, hash2, hash3) # works as well
```

## Useful functions
Some `ruby` functions:

Expand Down
1 change: 1 addition & 0 deletions Notes/templates/dairy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ tags: daily diary
---
### Todo


### Log
-

0 comments on commit 529ed57

Please sign in to comment.