dminuoso_

Activity Graph

Page 1 of 4 | Next »

2017-12-01

[02:14:59] dminuoso_: has joined #ruby-offtopic
[02:14:59] dminuoso_: has joined #ruby
[02:28:26] dminuoso_: has joined #ruby-offtopic
[02:28:30] dminuoso_: has joined #ruby
[10:47:21] dminuoso_: Yeah it's called moment.js

2017-10-13

[05:48:59] dminuoso_: has joined #RubyonRails-offtopic
[05:48:59] dminuoso_: has joined #ruby-offtopic
[05:48:59] dminuoso_: has joined #ruby
[05:49:07] dminuoso_: havenwood: class Integer def to_proc -> (e) { e[self] }; end; end
[05:49:12] dminuoso_: What do you think?
[05:49:27] dminuoso_: Is this more elegant than an nthL function?
[05:50:09] dminuoso_: I mean it's certainly more rubyesque considering Symbol#to_proc
[05:50:55] dminuoso_: >> class Integer def to_proc -> (e) { e[self] }; end; end; [[1,2],[3,4],[5,6]].map(&0)
[05:51:04] dminuoso_: ACTION kicks ruby[bot] 
[05:51:18] dminuoso_: >> class Integer def to_proc -> (e) { e[self] }; end; end; [[1,2],[3,4],[5,6]].map(&0)
[05:51:59] dminuoso_: >> class Integer def to_proc -> (e) { e[self] }; end; end; [[1,2],[3,4],[5,6]].map(&0)
[05:52:26] dminuoso_: >> class Integer def to_proc() -> (e) { e[self] }; end; end; [[1,2],[3,4],[5,6]].map(&0)
[06:23:07] dminuoso_: Ping timeout: 260 seconds
[06:28:40] dminuoso_: has joined #RubyonRails-offtopic
[06:28:40] dminuoso_: has joined #ruby-offtopic
[06:28:40] dminuoso_: has joined #ruby
[06:48:47] dminuoso_: Remote host closed the connection
[06:54:18] dminuoso_: has joined #ruby
[06:54:19] dminuoso_: has joined #RubyonRails-offtopic
[06:54:19] dminuoso_: has joined #ruby-offtopic
[07:10:30] dminuoso_: Quit: leaving

2017-10-12

[04:36:24] dminuoso_: has joined #RubyonRails-offtopic
[04:36:24] dminuoso_: has joined #ruby-offtopic
[04:36:24] dminuoso_: has joined #ruby
[04:42:41] dminuoso_: Ping timeout: 248 seconds
[05:33:19] dminuoso_: has joined #RubyonRails-offtopic
[05:33:19] dminuoso_: has joined #ruby-offtopic
[05:33:19] dminuoso_: has joined #ruby
[06:22:02] dminuoso_: Murugesan: If you have questions that you could not answer yourself by a reasonable amount of research using documentation and google, then this is possibly the right place.
[06:38:47] dminuoso_: has joined #RubyOnRails
[06:39:35] dminuoso_: Im working on a new rails 5 project at the moment. In dev I have this bizarre situation that for XHR the TTFB from localhost is roughly 700-1000ms on average
[06:40:11] dminuoso_: The rails log reports these requests as having finished in less than 50ms on average, what could be causing this massive delay here?
[06:40:42] dminuoso_: There's no intermediate layers, puma is listening to a TCP socket directly.
[06:43:49] dminuoso_: As far as I can tell from wireshark, the delay happens outside the browser.
[06:51:20] dminuoso_: matthewd: According to rack mini profiler the time reported by the rails log appears to be correct. Im not exactly sure how sprockets plays into this.
[06:51:49] dminuoso_: If its worth mentioning, Im using webpacker (which has its proxy inserted before the rack-mini-profiler middleware).
[07:00:12] dminuoso_: matthewd: Nope.
[07:00:40] dminuoso_: It just improves rendering times to about 1-2ms, but the TTFB remains around 700-1000ms.
[07:01:40] dminuoso_: sevenseacat: It's putting it to TTFB, and wireshark agrees.
[07:02:30] dminuoso_: sevenseacat: https://i.imgur.com/wJKLy2c.png
[07:03:50] dminuoso_: sevenseacat: As I said, its TTFB which means its a delay on the network interface (and beyond).
[07:03:57] dminuoso_: https://i.imgur.com/ObDbvNb.png
[07:04:11] dminuoso_: time to first byte
[07:04:37] dminuoso_: It's essentially the time difference that you can see in wireshark.
[07:12:26] dminuoso_: matthewd: Mmm, apparently RAILS_ENV=production was not enough. With -e production the problem disappears.
[07:47:21] dminuoso_: matthewd: Can I safely ignore the middlewares below the rack-mini-profiler middleware?
[07:47:40] dminuoso_: I mean according to the profiler the time spent below that middleware is just a few milliseconds.
[08:06:45] dminuoso_: matthewd: Heh. This just forced me to use fiddle and unfreeze Rails.config.middlewares.instance_variable_get(@:middlewares), because Rails.application.initialize! is what both injects that Webpacker middleware and *then* freezes the stack. :)
[08:09:56] dminuoso_: matthewd: Mmm, you are right - just mutating this object should not have any effects the more I think about it.
[08:10:08] dminuoso_: This proxy just collects actions how to set up the middleware stack.
[08:10:49] dminuoso_: And for some reason I can't insert_before Webpacker::DevServerProxy
[08:11:10] dminuoso_: But Im sure there is some window that I can monkey patch.
[09:25:51] dminuoso_: havenwood: https://gist.github.com/anonymous/d53c59e31cdaa1bbbb7b2c7a166f2e8e
[09:25:56] dminuoso_: This is my new way of writing elegant Ruby code.
[09:26:32] dminuoso_: That asterisk if you wonder is a self written Proc#* that acts as compose ;)
[09:29:55] dminuoso_: haha amazing :)
[09:32:12] dminuoso_: havenwood: I like that Proc.compose you write, especially with that :to_proc twist.
[09:32:27] dminuoso_: Though I'm thinking that reduces typing strength a bit too much
[09:37:18] dminuoso_: havenwood: The one thing I'm beginning to appreciate most is lenses though.
[09:58:40] dminuoso_: matthewd: This might be a silly question... but how do you move a middleware?
[09:59:07] dminuoso_: Turns out: middleware.delete Foo; middleware.insert_before 0, Foo; produces a stack without any Foo at all.
[10:02:02] dminuoso_: matthewd: That's the thing, I don't know *how*
[10:02:25] dminuoso_: Oh. I guess I could remove the initial insertion of Rack::Runtime
[10:02:34] dminuoso_: yeah Im already modifying actionpack
[10:06:06] dminuoso_: matthewd: Alright, it's not Webpackers middleware either :|
[10:22:27] dminuoso_: Ping timeout: 240 seconds
[10:31:29] dminuoso_: has joined #RubyonRails-offtopic
[10:31:29] dminuoso_: has joined #ruby-offtopic
[10:31:29] dminuoso_: has joined #ruby
[10:32:14] dminuoso_: has joined #RubyOnRails
[10:59:05] dminuoso_: matthewd: It's a bit bizarre. Havent been able to figure out where to tackle puma, but just comparing timings, the delay happens *after* rendering has been done (and logged)
[11:14:35] dminuoso_: Ping timeout: 240 seconds
[11:46:26] dminuoso_: has joined #ruby
[11:46:27] dminuoso_: has joined #RubyonRails-offtopic
[11:46:27] dminuoso_: has joined #ruby-offtopic
[11:48:13] dminuoso_: has joined #RubyOnRails
[11:48:29] dminuoso_: dionysus69: No.
[11:48:51] dminuoso_: dionysus69: As usual: As many permissions/roles as necessary, as little as possible.
[11:58:31] dminuoso_: felipebalbi: My two cents: Get a ruby book, learn it - and then dive into Rails using just the official guides.
[12:00:15] dminuoso_: felipebalbi: Each of which is best studied on its own.
[12:00:40] dminuoso_: felipebalbi: git? get the "Pro Git" book (its free from git-scm.com)
[12:00:51] dminuoso_: felipebalbi: Deployment? Complicated, as there's many rather complex approaches.
[12:01:16] dminuoso_: felipebalbi: Things like deployment can easily be ignored if you just want to start, and dived into later.
[12:02:15] dminuoso_: And the same thing applies to CSS. It's usually sufficient to just kick back and use bootstrap while you are bootstrapping yourself.
[12:02:33] dminuoso_: (And then perhaps ditch it once you have the necessary experience to focus on styling)
[12:04:34] dminuoso_: felipebalbi: The two important things to consider early is: raw ruby knowledge and basic git competency.
[12:04:41] dminuoso_: With those two equipped, the rails guides get you pretty far. :)
[12:05:55] dminuoso_: felipebalbi: I didn't learn HTML nuances until much later. Now for example I understand that <h1><div /></h1> is invalid HTML5 because nowadays I just refer to the specification.
[12:34:26] dminuoso_: matthewd: It's happening with all servers (webrick, unicorn, puma) ...
[12:35:19] dminuoso_: With webrick at least I get a log statement when the request gets sent, so its more visible there
[12:35:43] dminuoso_: Seems like I have to follow Alice.
[12:37:29] dminuoso_: matthewd: can you point me in the direction what code I should be looking at?
[12:37:43] dminuoso_: I have very little experience about how rails itself works here
[13:03:37] dminuoso_: matthewd: Maybe Im misunderstanding something here, but what do you mean by "active" ?
[13:04:15] dminuoso_: The whole BodyProxy looks really strange, and neither the usages, the specs - nor the complete lack of any documentation explains what this is for.
[13:31:43] dminuoso_: Ping timeout: 248 seconds
[13:59:43] dminuoso_: has joined #RubyonRails-offtopic
[13:59:43] dminuoso_: has joined #ruby-offtopic
[13:59:43] dminuoso_: has joined #ruby
[14:03:05] dminuoso_: has joined #RubyOnRails
[14:03:30] dminuoso_: Mmm, think I get the idea. It just provides for finalization after #each is called.
[14:18:19] dminuoso_: matthewd: I found the culprit, there seems to be some really buggy behavior in the Webpacker::DevServer implementation.
[14:18:57] dminuoso_: Which explains why the problem does not appear on production, because there is no such server running.
[14:20:15] dminuoso_: https://github.com/rails/webpacker/issues/745
[14:21:44] dminuoso_: Clearly that needs a solution with unix domain sockets, which is infinitely faster to probe for.
[14:27:15] dminuoso_: Ping timeout: 246 seconds
[18:04:40] dminuoso_: has joined #RubyonRails-offtopic
[18:04:40] dminuoso_: has joined #ruby-offtopic
[18:04:40] dminuoso_: has joined #ruby
[18:30:27] dminuoso_: Ping timeout: 240 seconds
[19:36:23] dminuoso_: has joined #RubyonRails-offtopic
[19:36:23] dminuoso_: has joined #ruby-offtopic
[19:36:23] dminuoso_: has joined #ruby
[19:40:27] dminuoso_: Ping timeout: 240 seconds

2017-10-11

[05:52:50] dminuoso_: has joined #RubyonRails-offtopic
[05:52:50] dminuoso_: has joined #ruby-offtopic
[05:52:50] dminuoso_: has joined #ruby
[05:59:30] dminuoso_: More importantly
[05:59:33] dminuoso_: Where is apeiros :(
[05:59:42] dminuoso_: Need someone to throw paper at.
[06:03:24] dminuoso_: baweaver: Fun stuff, do you ever wake up at 6 in the morning, realizing that an isomorphism is both a monomorphism and an epimorphism, but that the inverse does not hold true?
[06:03:38] dminuoso_: Man I should study maths. :(
[06:04:11] dminuoso_: Yes. Rectangles.
[06:04:39] dminuoso_: main contributor?
[06:05:06] dminuoso_: eckhardt: Here we decided to rewrite our rails app from 4 to 5 to fix all our mistakes and headaches.
[06:05:16] dminuoso_: From scratch.
[06:05:59] dminuoso_: And you work at that place with eam?
[06:06:03] dminuoso_: Ahh, I remembered correctly.
[06:06:28] dminuoso_: I need to get a new place to work at I think.
[06:09:44] dminuoso_: US is not something I want to consider for numerous reasons.
[06:11:10] dminuoso_: Was considering about something new earlier this year, but there were too many things I had to take care of first.
[06:11:48] dminuoso_: Who or what is BART?
[06:12:15] dminuoso_: Oh. Should google more frequently.
[06:12:30] dminuoso_: Time to study more cateogry theory.
[06:13:25] dminuoso_: Clearly eam has been woken up by the amount of 0x07 chars he has gotten.
[06:16:37] dminuoso_: eckhardt: Have you considered this? http://i.ebayimg.com/00/s/NTcxWDQ2NQ==/z/8V4AAOSwHnFVnax2/$_35.JPG
[06:22:55] dminuoso_: Ping timeout: 248 seconds
[06:32:28] dminuoso_: has joined #RubyonRails-offtopic
[06:32:28] dminuoso_: has joined #ruby-offtopic
[06:32:28] dminuoso_: has joined #ruby
[06:50:14] dminuoso_: Remote host closed the connection
[07:12:36] dminuoso_: has joined #RubyonRails-offtopic
[07:12:36] dminuoso_: has joined #ruby-offtopic
[07:12:36] dminuoso_: has joined #ruby
[08:58:43] dminuoso_: has joined #RubyOnRails
[09:01:23] dminuoso_: super: no superclass method `username'
[09:01:39] dminuoso_: Apparently this toxic class uses method_missing? in *some* class in the ancestory.
[09:01:50] dminuoso_: Why doesn't super respect method_missing? ....
[09:04:40] dminuoso_: Oh. Indeed.
[09:05:38] dminuoso_: matthewd: What API would I be looking for?
[09:05:42] dminuoso_: matthewd: Yeah, already on that.
[09:18:03] dminuoso_: matthewd: https://gist.github.com/anonymous/31a395404e3073eaa9e57b62f1c7ef5a it actually doesn't look too horrible with prepend and an inline module definition :)
[09:22:22] dminuoso_: Should probably use caller_locations over caller though.
[10:51:35] dminuoso_: Ping timeout: 240 seconds
[11:43:08] dminuoso_: has joined #RubyonRails-offtopic
[11:43:08] dminuoso_: has joined #ruby-offtopic
[11:43:08] dminuoso_: has joined #ruby
[13:47:15] dminuoso_: t0th_-: Show us your pg_hba.conf and whatever code/yaml you use to configure pg.
[14:34:34] dminuoso_: Ping timeout: 264 seconds

2017-10-10

[13:03:47] dminuoso_: collection.map(&func).select(&predicate).reduce(&:+)
[13:04:48] dminuoso_: noizex: But I have a highly FP approach to ruby these days.
[13:05:14] dminuoso_: bash_n00b: what ruby version are you running?
[13:07:00] dminuoso_: bash_n00b: You have a rather old ruby version (which at the time did not ship with JSON out of the box).
[13:07:23] dminuoso_: bash_n00b: Either install the json gem (which means you also need to require 'rubygems' in your project), but it's probably much better to upgrade to modern Ruby such as 2.4.2.
[13:09:43] dminuoso_: guymanndude: There's no real convention wrt that. Personally I would not list any dependencies that are already covered in gemspecs
[13:11:01] dminuoso_: guymanndude: That ruby version is highly likely to be too open.
[13:11:41] dminuoso_: guymanndude: Ruby has a tendency to break things across minor releases.
[13:12:22] dminuoso_: guymanndude: Yes, but can you promise that it will be compatible to ruby 2.5, 2.6, 2.7, 2.8, an so forth?
[13:13:01] dminuoso_: guymanndude: Ah actually its probably fine.
[13:13:05] dminuoso_: Go for it. :)
[13:13:11] dminuoso_: https://github.com/rails/rails/blob/master/rails.gemspec
[13:13:23] dminuoso_: https://github.com/sinatra/sinatra/blob/master/sinatra.gemspec
[13:14:23] dminuoso_: https://github.com/bundler/bundler/blob/master/bundler.gemspec
[13:14:29] dminuoso_: Seems like a lot of projects do it like that.
[13:15:42] dminuoso_: guymanndude: SemVer has you covered.
[13:16:35] dminuoso_: guymanndude: As far as I can tell, according to SemVer a minor version bump is sufficient.
[13:17:02] dminuoso_: Though you could argue its not exactly backwards compatible
[13:17:17] dminuoso_: But its not an API change.
[13:17:41] dminuoso_: guymanndude: SemVer focuses on how stable the API is.
[13:18:52] dminuoso_: If I use library XYZ, and I update its minor version, it should not require me to change my code that uses the same library.
[13:35:25] dminuoso_: xco: Do you want the quick and dirty solution, or the proper solution?
[13:37:09] dminuoso_: xco: Use URI.parse, the resulting object has a #path method, which you can then split using '/'
[13:37:37] dminuoso_: Then you have a clean way of lensing into the value you want, without any silly regular expressions.
[13:38:04] dminuoso_: (Or you can use a regular expression against the #path)
[13:40:04] dminuoso_: xco: %r{users/(\d+)/books_read} ?
[13:40:40] dminuoso_: xco: %r{/admin/users/(\d+)/books_read} perhaps might be a bit cleaner
[13:41:37] dminuoso_: xco: %r{/admin/users/(?<user_id>\d+)/books_read} if you want a named capture
[13:41:55] dminuoso_: That's what this does.
[13:44:17] dminuoso_: xco: You could technically use #[] and then use magic variables, or better use .match and then use the resulting match object.
[13:46:08] dminuoso_: xco: https://eval.in/877259
[13:46:26] dminuoso_: xco: Im a big fan of using named captures, but you can also use unnamed captures (which are then referred to by position).
[13:46:55] dminuoso_: swat2: a - b, b - a
[13:47:43] dminuoso_: That last condition is a bit annoying.
[13:49:32] dminuoso_: swat2: #- does not care about the order of arrays.
[13:49:54] dminuoso_: swat2: #- gives you the complement of two arrays (treating them as sets)
[13:50:42] dminuoso_: *gah. Difference
[13:51:06] dminuoso_: So A - B is mathematically equivalent to A \ B.
[13:53:57] dminuoso_: swat2: Do you care about the position in the array at all?
[13:54:47] dminuoso_: swat2: Consider using Set instead of Array then.
[13:55:33] dminuoso_: Though keep in mind that a set cant have duplicates.
[14:04:30] dminuoso_: swat2: naah, I wouldn't generate an array to begin with :p
[14:04:49] dminuoso_: Or just ignore it and use arrays away.
[14:10:54] dminuoso_: swat2: There's little point to coerce an array to set unless you wanted the special behavior that set gives you.
[14:36:21] dminuoso_: Ping timeout: 240 seconds
[14:48:39] dminuoso_: has joined #RubyonRails-offtopic
[14:48:39] dminuoso_: has joined #ruby-offtopic
[14:48:39] dminuoso_: has joined #ruby
[15:12:28] dminuoso_: Remote host closed the connection
[16:22:46] dminuoso_: has joined #RubyonRails-offtopic
[16:22:46] dminuoso_: has joined #ruby-offtopic
[16:22:46] dminuoso_: has joined #ruby
[16:54:59] dminuoso_: has joined #RubyOnRails
[16:55:01] dminuoso_: https://gist.github.com/anonymous/61bbaa1207d8033f0798a744e034432e
[16:55:05] dminuoso_: This is just cancer.
[16:56:04] dminuoso_: fChanX: Yes it quite is.
[16:56:12] dminuoso_: I keep recommending it, but I've never read it.
[16:56:27] dminuoso_: ACTION pokes a hole into baweaver 
[16:56:49] dminuoso_: baweaver: https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
[16:56:54] dminuoso_: this is an amazing read
[16:57:41] dminuoso_: He's also published a series of lectures covering the same topic, it starts smooth with basic categories and ends up talking about f algebras and kan extensions later.
[17:06:18] dminuoso_: havenwood: if you survive, let me know.
[17:06:25] dminuoso_: If you dont, can I have your stuff?
[17:25:21] dminuoso_: havenwood: that reminds me
[17:25:44] dminuoso_: I wanted to implement Proc#to_yaml and Proc.from_yaml
[17:25:54] dminuoso_: What could possibly go wrong.
[17:26:40] dminuoso_: havenwood: yield_self as a poor-mans |> ?
[17:26:48] dminuoso_: That reads so... horrible.
[17:27:07] dminuoso_: havenwood: Yes, but Im adressing it the proper way.
[17:27:17] dminuoso_: RubyVM::InstructionSequence is my bread and butter.
[17:27:43] dminuoso_: Currently devising a method of plugging in digitally signing the proc.
[17:27:55] dminuoso_: (So that it's actually safe to to_yaml/from_yaml)
[17:28:36] dminuoso_: havenwood: waaaait. yield_self is destructive?
[17:28:39] dminuoso_: how freaking annoying is that.
[17:29:30] dminuoso_: Oh it doesn't - it helps if you can read.
[17:35:04] dminuoso_: havenwood: Using ObjectSpace.load we could implement the "swipe" action you see folks on the series "24", when somebody says "Give me your terminal", and they just swipe it across screens.
[18:34:05] dminuoso_: Ping timeout: 240 seconds