« Back to channel list

#ruby - 20 April 2019

« Back 1 day Forward 1 day »
[00:17:57] truenito: has joined #ruby
[00:19:44] bambanx: has joined #ruby
[00:46:10] jrafanie: has joined #ruby
[00:56:05] Net: Is there a better way to write `@users[@users.index { |u| u.id == id }] = user`?
[00:57:07] Swyper: has joined #ruby
[00:58:24] tdy2: has joined #ruby
[01:00:06] dsmythe: has joined #ruby
[01:01:15] adam12: Net: Maybe? Can you share more than a single line?
[01:02:09] Net: adam12: you're wondering if @users should be a hash?
[01:03:08] adam12: Net: It might be faster lookup when concerning big-O, but in reality you have 2 guest objects so I'm presuming the puzzle is larger than a single line.
[01:03:37] Net: adam12: it's not, I'm just lazy. It'll get refactored to a hash later
[01:04:07] Net: my question was solely if there was a better way to update an element on an array based on a condition
[01:04:40] AJA4351: has joined #ruby
[01:04:50] Net: trying to familiarize myself with the stdlib :)
[01:05:14] adam12: Net: It looks fine as it is, but if that line is nested in a loop there's a chance it's suboptimal.
[01:05:53] Net: thanks!
[01:06:55] havenwood: Net: Are there no duplicates in the Array?
[01:06:59] Net: havenwood: no dupes
[01:07:15] havenwood: Net: A Set would also work. You could delete the old and add the new.
[01:08:03] havenwood: Net: A Hash has appealing aspects if you're searching by ID.
[01:08:32] Net: interesting. in this case it's just a hacky way to update some json in redis until I move this data into postgres, but I'll keep that in mind
[01:09:47] havenwood: Net: With a Set: @users.delete(@users.find { |u| u.id == id }) << user
[01:10:08] Net: Any recommended books or articles for learning ruby and RoR?
[01:10:42] Net: I've worked with both years ago, but I could use some reading to brush up—I don't remember much.
[01:11:21] Net: Really I just want to get a feel for common idioms and more advanced concepts
[01:11:58] havenwood: Net: The Rails docs are a pretty good read. I like just reading nicely written Ruby code for patterns.
[01:12:19] Net: and where might I find nicely written Ruby code? :)
[01:13:03] havenwood: Net: I just saw a reallly nice Ruby cookbook, but it's in Japanese. ¯\_(ツ)_/¯
[01:13:12] havenwood: Maybe there's an English version?
[01:13:39] havenwood: The Well Grounded Rubyist isn't super advanced, but it just had a new version released.
[01:14:04] havenwood: Net: It looks like there's "Wicked Cool Ruby Scripts" (i haven't read it)
[01:14:29] havenwood: Net: or Kestrels, Quirky Birds, and Hopeless Egocentricity
[01:14:56] mangold: has joined #ruby
[01:15:16] havenwood: Net: Or GitHub has a ton of great code reading!
[01:15:32] Net: I've got The Well Grounded Rubyest 3rd ed. on Kindle, What's Kestrels, Quirky Birds, and Hopeless Egocentricity about?
[01:16:04] Net: Looks like haskell in ruby
[01:16:29] Net: any specific GitHub projects?
[01:17:04] havenwood: Net: Jeremy Evans is about to give a talk at RubyKaigi on how he used best practices to make Sequel and Roda competitively fast. Those are great.
[01:17:07] havenwood: Net: https://github.com/jeremyevans/roda/blob/master/lib/roda.rb
[01:18:08] Net: Do I need to learn Japanese?
[01:18:53] havenwood: Net: Here're some Ruby project's I've starred: https://github.com/havenwood?language=ruby&tab=stars
[01:19:18] Net: Worth watching past RubyKaigi talks?
[01:19:23] Net: thanks!
[01:19:41] havenwood: Net: Yeah, RubyKaigi talks are great! I'd suggest watching RubyConf and RailsConf talks too.
[01:20:04] Net: Will do, thank you!
[01:20:48] Net: great commenting in roda
[01:20:54] havenwood: Net: And all talks Rich Hickey has given ;) He's an oracle
[01:21:13] adam12: Just beware that Roda is obsessed with performance and some code is a bit more opaque because of that. Jeremy comes up with some very creative solutions.
[01:21:14] Net: 👍🏼
[01:21:18] adam12: Any talks with Sandy Metz are great too.
[01:22:38] duderonomy: has joined #ruby
[01:23:36] adam12: havenwood: are you at rubykaigi now?
[01:23:43] havenwood: adam12: yup!
[01:23:49] adam12: havenwood: favourite talk so far?
[01:24:42] havenwood: adam12: Day 1, Fibers are the Right Solution by ioquatix
[01:25:04] adam12: havenwood: Ah yeah. Excited to watch that. Been following Falcon fairly closely.
[01:25:05] havenwood: adam12: Day 2, Beyond `puts`: TruffleRuby's Modern Debugger using Chrome y nirvdrum
[01:25:30] adam12: havenwood: That sounds like a good one. I feel like CRuby getting that ability would be a huge step forward too.
[01:25:37] havenwood: I think those are both really exciting!
[01:25:47] havenwood: adam12: Yeah, it seems very possible for CRuby and JRuby too
[01:25:59] adam12: havenwood: Did you catch the zeitwork loader one?
[01:26:27] adam12: havenwood: or the new gem dependency one from matthewd? interested in both.
[01:26:29] havenwood: adam12: No, I wanted to but missed it
[01:26:47] adam12: Code loading is probably my biggest painpoint right now.
[01:27:10] adam12: (and in that, code reloading to some degree)
[01:27:55] havenwood: For folk who aren't familiar, Gel! https://github.com/gel-rb/gel
[01:28:19] havenwood: `gem install -g` ftw ;P
[01:28:47] unixabg: havenwood: first thank you for the response. I did not know if there was something built in I could not see. I will look into a gem.
[01:29:38] havenwood: adam12: I look forward to Zeitwerk - seems like a huge improvement
[01:29:47] havenwood: https://github.com/fxn/zeitwerk
[01:38:40] ricekrispie: has joined #ruby
[01:39:10] AJA4351: has joined #ruby
[01:40:56] mat_bug: has joined #ruby
[01:49:10] unixabg: has left #ruby: ()
[01:54:42] Swyper: has joined #ruby
[02:26:13] noobineer: has joined #ruby
[02:27:11] IGnorAND: I seriously need to go read up on rspec with context/describe and let. I'm getting errors because my let isn't being executed :(
[02:27:26] mat_bug: has joined #ruby
[02:29:34] laaron: has joined #ruby
[02:29:54] Ai9zO5AP: has joined #ruby
[02:47:46] duderonomy: has joined #ruby
[02:48:49] apparition: has joined #ruby
[02:55:18] KeyJoo: has joined #ruby
[03:06:33] DmitryBochkarev: has joined #ruby
[03:13:01] braincras: has joined #ruby
[03:35:42] pupsikov: has joined #ruby
[03:44:28] AndroidKitKat: has joined #ruby
[03:57:53] dsmythe: has joined #ruby
[04:08:17] Nicmavr: has joined #ruby
[04:17:29] tdy: has joined #ruby
[04:21:10] _whitelogger: has joined #ruby
[04:30:04] mat_bug: has joined #ruby
[04:40:17] maryo: has joined #ruby
[04:46:35] guatajuk: has joined #ruby
[04:48:45] pupsikov: has joined #ruby
[04:54:15] kapil____: has joined #ruby
[05:01:10] Swyper: has joined #ruby
[05:03:19] rippa: has joined #ruby
[05:08:28] cd: has joined #ruby
[05:13:16] DmitryBochkarev: has joined #ruby
[05:39:26] pupsikov: has joined #ruby
[05:43:33] dellavg_: has joined #ruby
[05:57:49] schleppel: has joined #ruby
[06:00:56] iMadper: has joined #ruby
[06:18:53] ramfjord: has joined #ruby
[06:40:34] duderonomy: has joined #ruby
[06:40:44] apparition: has joined #ruby
[06:42:54] hightower2: has joined #ruby
[06:49:45] Swyper: has joined #ruby
[06:53:46] sameerynho: has joined #ruby
[06:59:50] ljarvis__: has joined #ruby
[07:03:02] nakuku: has joined #ruby
[07:06:11] bugtender: has joined #ruby
[07:13:11] DmitryBochkarev: has joined #ruby
[07:17:43] flak: has joined #ruby
[07:18:46] mat_bug: has joined #ruby
[07:18:49] cedum: has joined #ruby
[07:22:39] j416: has joined #ruby
[07:23:13] sagax: has joined #ruby
[07:23:18] ua: has joined #ruby
[07:30:56] bugtender: has joined #ruby
[07:37:06] def_jam: has joined #ruby
[07:37:29] eb0t_: has joined #ruby
[08:00:18] mat_bug: has joined #ruby
[08:17:33] mangold: has joined #ruby
[08:19:10] ramfjord: has joined #ruby
[08:25:58] eb0t: has joined #ruby
[08:26:05] eblip: has joined #ruby
[08:27:08] kyrylo: has joined #ruby
[08:27:56] Dbugger: has joined #ruby
[08:28:05] conta: has joined #ruby
[08:28:30] ziyadb: has left #ruby: ()
[08:28:57] dsmythe: has joined #ruby
[08:41:21] mat_bug: has joined #ruby
[09:01:13] dhollinger: has joined #ruby
[09:29:45] jefffrails35: has joined #ruby
[09:32:20] jefffrails35: has joined #ruby
[09:40:40] jefffrails35: has joined #ruby
[09:58:14] fphilipe: has joined #ruby
[09:59:27] mangold: has joined #ruby
[10:19:19] ramfjord: has joined #ruby
[10:21:54] nowhere_man: has joined #ruby
[10:22:17] tdy: has joined #ruby
[10:26:01] Inline: has joined #ruby
[10:26:06] fphilipe: has joined #ruby
[10:33:46] RedNifre: has joined #ruby
[10:38:15] clemens3_: has joined #ruby
[10:58:24] Inline: has joined #ruby
[11:00:06] ellcs: has joined #ruby
[11:01:06] pwnd_nsfw`: has joined #ruby
[11:01:40] nowhere_man: has joined #ruby
[11:10:23] AJA4350: has joined #ruby
[11:13:10] kyrylo: has joined #ruby
[11:13:21] nowhere_man: has joined #ruby
[11:19:39] matti: has joined #ruby
[11:20:06] RedNifre: has joined #ruby
[11:20:49] DmitryBochkarev: has joined #ruby
[11:38:20] UncleCid__: has joined #ruby
[11:48:55] Inline: has joined #ruby
[12:03:59] nowhere_man: has joined #ruby
[12:05:23] temporal_0: has joined #ruby
[12:18:10] _whitelogger: has joined #ruby
[12:22:35] mangold: has joined #ruby
[12:27:37] nadir: has joined #ruby
[12:31:26] iNs: has joined #ruby
[12:44:48] RedNifre: has left #ruby: ("WeeChat 1.9.1")
[12:52:18] Inline: has joined #ruby
[12:58:07] Fernando-Basso: has joined #ruby
[13:01:23] hightower2: has joined #ruby
[13:06:14] dsmythe: has joined #ruby
[13:08:12] galaxie: has joined #ruby
[13:12:21] phaul: has joined #ruby
[13:12:42] guatajuk: has joined #ruby
[13:34:27] galeido: has joined #ruby
[13:53:36] laaron: has joined #ruby
[14:01:23] pupsikov: has joined #ruby
[14:34:37] cranq: has joined #ruby
[14:35:35] cow[moo]: has joined #ruby
[14:37:02] cow[moo]: has joined #ruby
[14:41:02] tdy: has joined #ruby
[14:42:37] sphenxes: has joined #ruby
[14:45:04] lomex: has joined #ruby
[14:45:14] TiglatePileser: has joined #ruby
[14:45:44] h3ll0w0rld: has joined #ruby
[14:51:59] lucasb: has joined #ruby
[14:57:47] Nicmavr: has joined #ruby
[15:03:30] Swyper: has joined #ruby
[15:15:36] cow[moo]: has joined #ruby
[15:17:15] nadir: has joined #ruby
[15:18:09] jottr: has joined #ruby
[15:32:01] DmitryBochkarev: has joined #ruby
[15:40:58] h3ll0w0rld: has joined #ruby
[15:47:56] h3ll0w0rld: has joined #ruby
[15:50:49] DmitryBochkarev: has joined #ruby
[15:55:12] Swyper: has joined #ruby
[15:58:20] suukim: has joined #ruby
[16:01:25] cow[moo]: has joined #ruby
[16:02:59] fphilipe: has joined #ruby
[16:23:54] cow[moo]: has joined #ruby
[16:27:07] cow[moo]: has joined #ruby
[16:30:56] DmitryBochkarev: has joined #ruby
[16:32:18] DmitryBochkarev: has joined #ruby
[16:36:50] AJA4351: has joined #ruby
[16:48:11] jesfre: has joined #ruby
[16:50:00] guatajuk: has joined #ruby
[16:56:06] DmitryBochkarev: has joined #ruby
[16:57:13] reber: has joined #ruby
[16:58:23] cow[moo]: has joined #ruby
[17:02:55] zachk: has joined #ruby
[17:04:33] zachk: has joined #ruby
[17:22:53] jefffrails35: has joined #ruby
[17:24:44] vrih: has joined #ruby
[17:34:42] d^sh: has joined #ruby
[17:34:43] cow[moo]: has joined #ruby
[17:34:49] guatajuk: has joined #ruby
[17:35:03] SuperL4g: has joined #ruby
[17:43:39] layer: has joined #ruby
[17:52:00] pupsikov: has joined #ruby
[17:52:24] SuperLag: has joined #ruby
[17:55:27] cow[moo]: has joined #ruby
[18:15:20] hightower3: has joined #ruby
[18:17:07] Swyper: has joined #ruby
[18:24:30] Swyper: has joined #ruby
[18:36:31] ellcs: has joined #ruby
[18:40:08] hiroaki: has joined #ruby
[18:41:58] DmitryBochkarev: has joined #ruby
[18:50:34] Swyper: has joined #ruby
[19:05:33] agent_white: has joined #ruby
[19:06:26] s3nd1v0g1us: has joined #ruby
[19:07:57] DmitryBochkarev: has joined #ruby
[19:12:42] laaron: has joined #ruby
[19:16:12] dsmythe: has joined #ruby
[19:16:52] clemens3_: has joined #ruby
[19:18:16] s3nd1v0g1us: has joined #ruby
[19:21:36] nadir: has joined #ruby
[19:21:37] _joes_: has joined #ruby
[19:22:50] hightower3: has joined #ruby
[19:40:01] BH23: has joined #ruby
[19:41:39] weird_error: has joined #ruby
[19:54:26] jottr: has joined #ruby
[20:02:55] mozzarella: has joined #ruby
[20:04:10] fphilipe: has joined #ruby
[20:05:15] mozzarella: has joined #ruby
[20:08:51] mozzarella: has joined #ruby
[20:14:37] houhoulis: has joined #ruby
[20:20:36] minimal_life: has joined #ruby
[20:23:11] AJA4350: has joined #ruby
[20:46:04] fphilipe: has joined #ruby
[20:54:14] fphilipe: has left #ruby: ("WeeChat 2.4")
[20:56:18] fphilipe: has joined #ruby
[21:03:10] wallace_mu: has joined #ruby
[21:03:12] _whitelogger: has joined #ruby
[21:13:31] reber: has joined #ruby
[21:13:54] fphilipe: has joined #ruby
[21:15:51] fphilipe: has joined #ruby
[21:21:02] fphilipe_: has joined #ruby
[21:22:31] hightower3: has joined #ruby
[21:26:33] wildermind: has joined #ruby
[21:29:39] dsmythe_: has joined #ruby
[21:36:15] Swyper: has joined #ruby
[21:37:24] dsmythe: has joined #ruby
[21:54:28] AJA4351: has joined #ruby
[22:23:47] dsmythe: has joined #ruby
[22:24:48] dkmueller: has joined #ruby
[22:29:18] dkmueller: has joined #ruby
[22:38:56] dkmueller: has joined #ruby
[22:39:51] dkmueller: has joined #ruby
[22:41:06] dkmueller: has joined #ruby
[22:45:02] SCHAPiE: has joined #ruby
[23:00:24] AJA4351: has joined #ruby
[23:03:47] RiPuk: has joined #ruby
[23:08:43] fphilipe: has joined #ruby
[23:14:29] jottr_: has joined #ruby
[23:30:55] krawchyk: has joined #ruby
[23:36:25] jottr: has joined #ruby
[23:54:02] agent_white: has joined #ruby