woodruffw

Activity Graph

Page 1 of 4 | Next »

2019-07-15

[08:37:54] woodruffw: Ping timeout: 248 seconds
[08:41:54] woodruffw: has joined #ruby
[08:41:54] woodruffw: Changing host
[08:41:54] woodruffw: has joined #ruby

2019-07-11

[13:49:00] woodruffw: Ping timeout: 258 seconds
[13:53:20] woodruffw: has joined #ruby
[13:53:21] woodruffw: has joined #ruby
[13:53:21] woodruffw: Changing host

2019-07-07

[06:15:40] woodruffw: Ping timeout: 272 seconds
[06:16:24] woodruffw: has joined #ruby
[06:16:25] woodruffw: has joined #ruby
[06:16:25] woodruffw: Changing host

2019-06-04

[01:44:37] woodruffw: has joined #ruby
[01:44:37] woodruffw: Changing host
[01:44:37] woodruffw: has joined #ruby
[02:00:30] woodruffw: Read error: Connection reset by peer
[02:01:30] woodruffw: has joined #ruby
[02:01:30] woodruffw: Changing host
[02:01:30] woodruffw: has joined #ruby
[03:11:30] woodruffw: `class2.handle_save(class1.whatever)` maybe? unless i'm misunderstanding
[03:12:32] woodruffw: you could add an instance method to class1 that calls class2.handle_save
[03:15:12] woodruffw: depends on the context you're in
[03:15:39] woodruffw: if you're writing an instance method on class1, self will refer to your current class1 instance
[03:18:00] woodruffw: `self.call` will try to call the `call` method, which probably doesn't exist
[03:18:28] woodruffw: you can use `send` to send methods to arbitrary objects, but that usually isn't what you want when getting started with ruby's OOP

2019-05-23

[05:32:54] woodruffw: Ping timeout: 252 seconds

2019-05-09

[11:10:03] woodruffw: Ping timeout: 268 seconds
[11:10:48] woodruffw: has joined #ruby
[11:10:48] woodruffw: Changing host
[11:10:48] woodruffw: has joined #ruby

2019-04-30

[12:28:09] woodruffw: quarters: yep, both should be linear/linear with some coefficient (since you're applying an additional test to the key)

2019-04-28

[05:23:22] woodruffw: quarters: `find` and `find_all` both work on hashes: `foo.find_all { |k, _| k.start_with? "prefix" }` should work
[05:25:32] woodruffw: (you can use `to_h` to turn the result of `find_all` back into a hash`
[05:26:52] woodruffw: alternatively, `filter`/`filter!` will work just fine and the latter will return the modified hash

2019-04-22

[21:58:46] woodruffw: Ping timeout: 246 seconds
[22:01:05] woodruffw: has joined #ruby
[22:01:08] woodruffw: has joined #ruby
[22:01:08] woodruffw: Changing host

2019-04-13

[16:50:08] woodruffw: *.net *.split

2019-03-09

[08:04:05] woodruffw: elcontrastador: File#utime is probably the right way to do this
[08:04:14] woodruffw: https://ruby-doc.org/core-2.6.1/File.html#method-c-utime
[08:07:05] woodruffw: no problem :-)

2019-02-18

[19:37:57] woodruffw: single quotes don't allow interpolation; double quotes do
[19:38:25] woodruffw: i personally use double quotes everywhere and run `rubocop` to enforce things
[19:55:08] woodruffw: yeah, i change to the repo's convention if it doesn't match mine :p
[19:55:19] woodruffw: consistency above all

2019-01-13

[05:22:24] woodruffw: elcontrastador: `require` returns false when the library is already loaded
[05:22:38] woodruffw: so it's possible you've already loaded it; see if the `URI` constant is available
[05:24:10] woodruffw: yeah, that's strange, maybe it's become part of the corelib (i.e., the default requires)?
[05:24:39] woodruffw: or something in the corelib is requiring it transitively

2019-01-03

[20:50:28] woodruffw: Haris: if you user bundler, you can remove the whole vendor/ subdirectory
[20:50:40] woodruffw: i don't think there's a clean way to do it if you used `gem` directly

2018-12-11

[03:45:55] woodruffw: Ping timeout: 246 seconds
[03:48:48] woodruffw: has joined #ruby

2018-12-07

[20:38:39] woodruffw: Scriptonaut: enumerable.find { |x| x.blah? }
[20:39:04] woodruffw: you want the index?
[20:39:26] woodruffw: hmm, you could do find + tap probably
[20:39:42] woodruffw: err sorry no, that wouldn't work
[20:41:27] woodruffw: return `enumerable.find { |x| x.blah? }.first` maybe?
[20:51:13] woodruffw: right, i'm saying that you should return the element and then chain the calculation after it
[20:52:09] woodruffw: yeah, reduce then

2018-12-06

[12:53:06] woodruffw: Ping timeout: 244 seconds
[12:55:08] woodruffw: has joined #ruby

2018-12-03

[01:53:02] woodruffw: Quit: And then he took off.
[01:58:08] woodruffw: has joined #ruby

2018-11-28

[02:22:10] woodruffw: Ping timeout: 246 seconds
[02:27:44] woodruffw: has joined #ruby

2018-11-18

[01:33:28] woodruffw: galaxie: `require 'open-uri'; open('https://whatever')` doesn't work?
[02:48:24] woodruffw: galaxie: yeah, that's a problem with `open-uri` as a whole. as nchambers mentioned, net/http is probably the right way to go
[02:49:35] woodruffw: FWIW, using `net/http` is as simple as this: `Net::HTTP.get(URI(your_url))`
[02:49:48] woodruffw: that returns a `String` containing just the response body
[02:50:38] woodruffw: ref for open-uri being generally dangerous: https://sakurity.com/blog/2015/02/28/openuri.html
[03:00:47] woodruffw: galaxie: for that, you'll need to create a `Net::HTTP::Get` object, i think. that object can then be treated like a hash to add headers, e.g. `foo['X-Whatever'] = 'bar'`
[03:01:03] woodruffw: this seems to cover it: https://stackoverflow.com/questions/44839503/ruby-send-get-request-with-headers
[03:01:36] woodruffw: in terms of personal choice, that's where i'd switch to `httparty` or another gem for simplicity, unless it's just a short script
[05:02:07] woodruffw: woah, i had no idea __method__ or __callee__ existed

2018-11-16

[05:12:46] woodruffw: Ping timeout: 246 seconds
[06:24:32] woodruffw: has joined #ruby

2018-11-12

[21:19:33] woodruffw: Quit: And then he took off.
[21:21:17] woodruffw: has joined #ruby

2018-10-23

[17:51:26] woodruffw: if the string is exactly two words, String#split and Array#last are what you want
[17:51:37] woodruffw: otherwise, String#split and then get the first element
[17:51:44] woodruffw: err, second element, index 1

2018-09-14

[01:00:08] woodruffw: *.net *.split
[01:03:40] woodruffw: has joined #ruby

2018-09-13

[03:20:30] woodruffw: Resolv::MDNS is part of the stdlib, not familiar with anything for netbios or llmnr though

2018-09-03

[03:49:49] woodruffw: sounds like a mutex is what you want? https://ruby-doc.org/core-2.5.1/Mutex.html

2018-09-01

[03:53:53] woodruffw: JJonah: yes, you can define default values via the block that you pass to `define_method`
[03:55:29] woodruffw: see: https://eval.in/1052921
[03:59:22] woodruffw: hmm...this maybe? https://eval.in/1052922
[03:59:46] woodruffw: you should be able to split a hash in there instead, e.g., `foo **your_hash`
[03:59:54] woodruffw: splat*, not split
[04:01:04] woodruffw: that eval service is giving me internal server errors, maybe i should have chosen a better one :p
[04:01:54] woodruffw: here we go: https://repl.it/repls/BeneficialRoastedCron
[04:12:25] woodruffw: JJonah: yeah, i don't know if you can get both arbitrary keyword arguments *and* default values under ruby, unfortunately
[04:12:53] woodruffw: you can get what you want in that example, but i think you'll lose flexibility in terms of passing an arbitrary hash
[04:14:25] woodruffw: this works, but it doesn't handle default values for the trailing hash: https://hastebin.com/awupogezat.sql
[04:15:35] woodruffw: you could fake it by storing a default set of values somewhere and comparing the ones passed in **hsh to those
[04:28:03] woodruffw: nice; glad it works

2018-08-21

[20:19:28] woodruffw: *.net *.split
[20:20:02] woodruffw: has joined #ruby

2018-08-14

[00:57:13] woodruffw: *.net *.split
[01:04:29] woodruffw: has joined #ruby

2018-08-01

[09:28:02] woodruffw: Ping timeout: 248 seconds
[09:32:14] woodruffw: has joined #ruby

2018-07-20

[00:07:06] woodruffw: *.net *.split
[00:15:48] woodruffw: has joined #ruby

2018-06-19

[04:32:38] woodruffw: Ping timeout: 256 seconds
[04:39:50] woodruffw: has joined #ruby
[04:39:50] woodruffw: Changing host
[04:39:50] woodruffw: has joined #ruby

2018-06-18

[03:43:07] woodruffw: has joined #ruby
[03:43:07] woodruffw: Changing host
[03:43:07] woodruffw: has joined #ruby

2018-06-15

[03:51:27] woodruffw: has joined #ruby
[03:51:28] woodruffw: has joined #ruby
[03:51:28] woodruffw: Changing host
[06:52:47] woodruffw: Ping timeout: 255 seconds
[06:52:59] woodruffw: has joined #ruby
[06:52:59] woodruffw: Changing host
[06:52:59] woodruffw: has joined #ruby
[21:05:31] woodruffw: Quit: And then he took off.

2018-05-18

[16:08:33] woodruffw: Quit: And then he took off.

2018-05-15

[13:44:44] woodruffw: Excess Flood
[13:46:01] woodruffw: has joined #ruby
[13:46:01] woodruffw: Changing host
[13:46:01] woodruffw: has joined #ruby

2018-05-07

[05:14:20] woodruffw: Ping timeout: 268 seconds
[06:04:11] woodruffw: has joined #ruby
[06:04:11] woodruffw: Changing host
[06:04:11] woodruffw: has joined #ruby

2018-04-29

[16:51:21] woodruffw: Ping timeout: 264 seconds
[16:57:17] woodruffw: has joined #ruby
[16:57:17] woodruffw: Changing host
[16:57:17] woodruffw: has joined #ruby

2018-04-14

[17:44:46] woodruffw: Ping timeout: 256 seconds
[17:48:26] woodruffw: has joined #ruby
[17:48:27] woodruffw: has joined #ruby
[17:48:27] woodruffw: Changing host

2018-04-09

[01:50:09] woodruffw: has joined #ruby

2018-04-08

[22:02:12] woodruffw: has left #ruby: ("And then he took off.")

2018-03-24

[00:49:12] woodruffw: has joined #ruby
[00:49:12] woodruffw: Changing host
[00:49:12] woodruffw: has joined #ruby

2018-03-20

[23:40:33] woodruffw: Ping timeout: 264 seconds

2018-03-13

[12:55:52] woodruffw: Ping timeout: 268 seconds
[13:07:26] woodruffw: has joined #ruby
[13:07:26] woodruffw: Changing host
[13:07:26] woodruffw: has joined #ruby

2018-02-22

[10:57:57] woodruffw: Ping timeout: 264 seconds
[10:59:58] woodruffw: Ping timeout: 264 seconds

2018-02-18

[21:25:33] woodruffw: Ping timeout: 264 seconds
[21:33:07] woodruffw: has joined #ruby
[21:33:07] woodruffw: Changing host
[21:33:07] woodruffw: has joined #ruby

2018-02-09

[02:43:53] woodruffw: Quit: And then he took off.
[03:01:31] woodruffw: has joined #ruby
[03:01:31] woodruffw: Changing host
[03:01:31] woodruffw: has joined #ruby
[15:23:14] woodruffw: Ping timeout: 265 seconds
[15:26:58] woodruffw: has joined #ruby
[15:26:59] woodruffw: has joined #ruby
[15:26:59] woodruffw: Changing host

2018-02-07

[20:51:11] woodruffw: Ping timeout: 248 seconds
[20:53:39] woodruffw: has joined #ruby
[20:53:40] woodruffw: has joined #ruby
[20:53:40] woodruffw: Changing host

2018-02-03

[15:14:10] woodruffw: Ping timeout: 260 seconds
[18:01:13] woodruffw: has joined #ruby
[18:01:13] woodruffw: Changing host
[18:01:13] woodruffw: has joined #ruby
[18:52:36] woodruffw: Quit: And then he took off.
[18:57:42] woodruffw: has joined #ruby
[18:57:43] woodruffw: has joined #ruby
[18:57:43] woodruffw: Changing host

2018-01-14

[19:45:35] woodruffw: Ping timeout: 240 seconds
[19:47:04] woodruffw: has joined #ruby
[19:47:04] woodruffw: Changing host
[19:47:04] woodruffw: has joined #ruby
[20:37:32] woodruffw: Read error: Connection timed out
[20:46:50] woodruffw: has joined #ruby
[20:51:26] woodruffw: Ping timeout: 255 seconds
[23:32:12] woodruffw: has joined #ruby

2018-01-10

[18:45:45] woodruffw: Ping timeout: 260 seconds
[18:50:28] woodruffw: has joined #ruby
[18:50:28] woodruffw: Changing host
[18:50:28] woodruffw: has joined #ruby

2018-01-09

[02:22:29] woodruffw: Ping timeout: 252 seconds
[02:23:15] woodruffw: has joined #ruby
[02:23:15] woodruffw: Changing host
[02:23:15] woodruffw: has joined #ruby

2018-01-07

[04:47:24] woodruffw: Excess Flood
[04:51:05] woodruffw: has joined #ruby
[04:51:05] woodruffw: Changing host
[04:51:05] woodruffw: has joined #ruby

2018-01-06

[18:40:32] woodruffw: Ping timeout: 248 seconds
[18:46:32] woodruffw: has joined #ruby
[18:46:32] woodruffw: Changing host
[18:46:32] woodruffw: has joined #ruby

2018-01-02

[02:31:59] woodruffw: Ping timeout: 256 seconds
[02:34:58] woodruffw: has joined #ruby
[02:34:58] woodruffw: Changing host
[02:34:58] woodruffw: has joined #ruby

2017-12-14

[18:44:55] woodruffw: Ping timeout: 268 seconds
[18:48:26] woodruffw: has joined #ruby
[18:48:26] woodruffw: Changing host
[18:48:26] woodruffw: has joined #ruby

2017-12-12

[01:10:10] woodruffw: Ping timeout: 246 seconds
[01:16:53] woodruffw: has joined #ruby
[01:16:54] woodruffw: has joined #ruby
[01:16:54] woodruffw: Changing host
[03:46:22] woodruffw: Quit: And then he took off.
[03:50:00] woodruffw: has joined #ruby
[03:50:34] woodruffw: Changing host
[03:50:35] woodruffw: has joined #ruby
[04:46:21] woodruffw: Remote host closed the connection
[04:46:54] woodruffw: has joined #ruby
[04:46:55] woodruffw: has joined #ruby
[04:46:55] woodruffw: Changing host

2017-12-11

[00:19:29] woodruffw: Ping timeout: 268 seconds
[00:22:19] woodruffw: Changing host
[00:22:19] woodruffw: has joined #ruby
[00:22:20] woodruffw: has joined #ruby

2017-12-08

[20:51:58] woodruffw: has joined #ruby
[20:51:59] woodruffw: has joined #ruby
[20:51:59] woodruffw: Changing host

2017-12-04

[23:28:55] woodruffw: Read error: Connection reset by peer

2017-12-01

[02:28:42] woodruffw: has joined #ruby
[04:28:30] woodruffw: Read error: Connection reset by peer
[05:26:00] woodruffw: has joined #ruby
[05:26:00] woodruffw: Changing host
[05:26:00] woodruffw: has joined #ruby

2017-11-28

[04:12:17] woodruffw: Ping timeout: 248 seconds
[04:19:11] woodruffw: has joined #ruby
[04:19:12] woodruffw: has joined #ruby
[04:19:12] woodruffw: Changing host
[04:25:14] woodruffw: Read error: Connection reset by peer
[04:25:44] woodruffw: has joined #ruby
[04:25:45] woodruffw: has joined #ruby
[04:25:45] woodruffw: Changing host
[11:20:27] woodruffw: Read error: Connection reset by peer
[14:21:38] woodruffw: has joined #ruby
[14:21:38] woodruffw: Changing host
[14:21:38] woodruffw: has joined #ruby