soahccc

Activity Graph

Page 1 of 19 | Next »

2018-08-06

[13:42:25] soahccc: Ping timeout: 248 seconds

2018-07-20

[00:07:06] soahccc: *.net *.split
[00:15:50] soahccc: has joined #ruby

2018-06-15

[18:51:40] soahccc: Anyone familiar with curses? I'm not sure where the problem is but for some reason certain characters are broken on ubuntu (via ssh) vs. macOS locally. When I google I find things related to the terminal locale but it's the same for both, in fact if I force it to a non-utf8 it breaks completely. I suspect it to be curses but what should I do here? https://i.imgur.com/tO5AXDw.jpg
[18:55:43] soahccc: Oh nvm me, I had to install the cursesw (wide space something) and it works :)

2018-05-29

[02:46:51] soahccc: *.net *.split
[02:47:50] soahccc: has joined #ruby

2018-05-08

[14:07:58] soahccc: Ping timeout: 240 seconds
[14:12:21] soahccc: has joined #ruby

2018-05-07

[20:53:24] soahccc: *.net *.split

2018-04-25

[12:25:37] soahccc: *.net *.split
[12:27:11] soahccc: has joined #ruby
[15:01:07] soahccc: *.net *.split
[15:03:25] soahccc: has joined #ruby

2018-04-24

[01:16:33] soahccc: Ping timeout: 264 seconds
[01:20:45] soahccc: has joined #ruby

2018-04-11

[17:52:24] soahccc: has joined #ruby

2018-03-02

[21:23:01] soahccc: Ping timeout: 256 seconds
[21:25:00] soahccc: has joined #ruby

2018-02-09

[10:58:04] soahccc: I already thought that it might not work but is it "right" that constants defined in an instance_eval vanish into nothingness?
[11:01:37] soahccc: ups, rather class_eval, `self::CONSTANT = value` works though smh
[11:16:36] soahccc: dminuoso: I'm just playing with an idea so bear with me and this dirtyness :) https://gist.github.com/2called-chaos/2fd69601962e7e0866fd9fc49ccfb3af
[11:17:13] soahccc: dminuoso: I get that constants are lexically scoped but after the class eval the non-self:: constants are just gone, not in Module.constants anymore
[11:27:28] soahccc: dminuoso: hmm is it possible that pry is causing that?
[11:30:47] soahccc: I don't have this issue with a minimal example but what on earth could cause them to vanish here? It's one process, one thread, nothing fancy... https://gist.github.com/2called-chaos/c27eb8fc0b7e3fb179c978f286e81145
[11:36:06] soahccc: yeah but Module.constants always shows a list of top level constants, no?
[11:37:59] soahccc: Alright, I mean I have to use self:: anyway I suppose but I was curious as to where those constants ended up since it wasn't on self context
[11:38:44] soahccc: yeah but this lexical scope lookup thing is confusing sometimes
[11:43:27] soahccc: yeah now that I think about it. But what I meant is that even though code get's eval'd somewhere, constant lookup is not relative to that context but where it was defined, e.g. the lookup scope is defined by where the code is written
[11:44:20] soahccc: and the quirk with constant lookup and "shorthand class/module notation" aka class Foo::Bar::Baz
[11:46:16] soahccc: dminuoso: if you define a nested class or module in one line with the double colons the lookup/nesting is different as if you write them in multiple lines without the colons, you know what I mean? :D
[11:51:33] soahccc: I guess that's the gotcha with my evals :)
[11:52:41] soahccc: Btw I'm trying to evaluate if I'm capable of writing a sortof transcompile from and with ruby... Guess I'm missing a grade for that
[11:53:57] soahccc: and what about `class Foo::Bar` vs `class Foo; class Bar` and nesting?
[11:56:23] soahccc: I see, i find that kindof annoying at times to be honest, so much indentation just for that
[11:57:30] soahccc: dminuoso: and I was hoping to get away with a DSL but starting with keywords I'm kinda screwed already
[11:58:06] soahccc: yeah I know but do you really do that? fully address every class everytime?
[15:22:40] soahccc: I have this mostly in iterations and I then to `when x then next`
[17:37:56] soahccc: Anyone ever used net-scp? Is it any faster than net-sftp?
[17:52:00] soahccc: Meh, net-scp is indeed way faster but still CPU bound... any idea on how to find out where the bottleneck is? I assume somewhere in net-ssh
[17:52:38] soahccc: Or an alternative plan for fast and secure data transfer? Already thought about exposing the files via https, don't really want to shell out in the script

2018-02-06

[17:01:19] soahccc: lesce: is there something in .bundle/config in your project fodler?
[17:55:49] soahccc: SeepingN: Millions? what kind of botnet are you running eh? :D
[17:58:03] soahccc: I'm looking for a new side project (CLI, something with ncurses) but can't think of anything useful :(
[17:59:48] soahccc: I had so much fun with parallelization, deadlocks and racing conditions... my sudoku

2018-02-05

[01:34:59] soahccc: I just finished the most ludicrous and unnecessarily complicated CLI tool ever for a simple task that could be easily replaced by a 10-line shell script but I feel good :) After living in hell for 2 weeks
[01:40:55] soahccc: also can any postgres literate tell me if you can disable foreign key constraint checks over a series of processes and time and reactivate it after a few parallel imports are complete?
[01:53:06] soahccc: I understand that. I'm a dirty mysql person you know :D and if I want to add something to our website I pull live data to my dev machine but the whole DB is huge and takes ages. So I just pull the tables I need
[01:53:35] soahccc: but there will be integrity violations but I'm cool with it
[01:54:42] soahccc: atchoum: what would you do, if pulling the whole database, takes 4 hours?
[01:58:46] soahccc: I guess it depends on the use case. Surely one could solve it "better" but our way works good, I was just asking for psql. Some employees enter the boring data in our production backend and sometimes we have to add new features for specials, etc. and we just need a few tables which might reference data that we dont need.
[02:00:59] soahccc: I was just curious because I never worked with psql and I rewrote my "db sucker" tool to play with a few things and am trying to figure out if anyone is interested (also I was trying to find out if I ever can add psql support)
[02:02:05] soahccc: In the worst case I end up with a tool that only our company uses and I learned a bunch of things while creating it :)

2018-02-04

[13:20:18] soahccc: Are there gotchas in regards to overwriting methods from eval'd code? It's a terminal tool which can have a config.rb and it get's evald in the application instance and works pretty good (I know there might be more elegant ways). I can define non-existant methods and they are available. But if I try to redefine an existing one (and I checked that it does exist at that point) it seems to have no effect.
[13:28:23] soahccc: Is it maybe because the method I want to monkeypatch is from a module? https://gist.github.com/2called-chaos/53f2a2b82aa5b3ebd6a06b61ca3cca08
[13:39:45] soahccc: leitz: I use structs as stubs sometimes as you can .attribute it
[13:40:45] soahccc: you must rather :)
[13:42:04] soahccc: I use structs very rarely to be honest, I mostly rather have my own actual class
[13:42:51] soahccc: I guess another difference is that hash has no key constraints while struct only accepts the values you tell it to, openstruct on the other hand is pretty much like a hash
[13:45:44] soahccc: kinda depends on what those ints are and how they are used
[13:46:34] soahccc: you mean like creating one?
[13:49:36] soahccc: hmm I personally would go with classes there I guess, especially if you access them in different ways, e.g. comparing to stat sets
[13:51:30] soahccc: it's hard to say without seeing it :) but I guess hash, struct doesn't really matter
[14:04:09] soahccc: I thought I understood ruby metaprogramming but this makes no sense :( I can undef the method via instance_eval (I thought I'm already evaling in the instance) and then define the method, it's not there smh
[14:13:07] soahccc: in the eval'd file I can override methods if I put them inside instance_eval (despite the fact that I'm already in the instance, I can modify instance options, etc.). If I define methods without instance eval they are there but also for new classes, this is messed up
[14:20:10] soahccc: I guess eval is really evil at this point, instance_eval does the job
[14:26:43] soahccc: leitz: what exactly? there are a few gotchas but like 3 or 4
[14:45:57] soahccc: leitz: I don't see what your problem with self. was :D but what do you think of this alteration (I might have screwed the index number but generally :D) https://gist.github.com/2called-chaos/ff564280837ab47a1f0c6aaf2a78589c
[14:51:16] soahccc: leitz: I didn't change functionality, I just saw the explicit return and the manual counter (instead of with_index) and wanted to change it :D
[14:55:27] soahccc: konos5_: Do you really want to alter global Module? or is this just pseudo code? If you use an actual own module and include it in class it behaves like you expect
[14:56:21] soahccc: konos5_: it has to do something with class includes kernel and that bases of module or something complicated like that
[14:56:53] soahccc: but why do you want to tinker with global module class? :<

2018-01-18

[21:10:35] soahccc: Ping timeout: 240 seconds
[21:16:17] soahccc: has joined #ruby

2018-01-07

[20:35:07] soahccc: *.net *.split

2018-01-05

[15:21:21] soahccc: Does anyone use acme-client with Ruby? It recently stopped working in that everything I try to do results in timeouts. That is with most recent acme-client 0.6.2. I thought maybe the API url changed or something but it seems like it just stopped a month ago
[16:05:37] soahccc: Any idea how to debug this? I can't communicate with a specific host (letsencrypt API) but only from within ruby and only from this machine... I just started pry, require net/http and do a SSL get on the same exact target, one is working normally, one is timing out. I can curl it though. There is no firewall action going on. I'm confused :(
[16:22:38] soahccc: nchambers: https://gist.github.com/2called-chaos/810009183783743ac23b602437133058
[16:22:46] soahccc: I suspect it's some ipv6 shinanigans?
[16:23:39] soahccc: Because if I resolv the IP before it works (except SSL mismatch ofc but the connection establishes)
[16:24:24] soahccc: The thing is I can Net::HTTP get other domains that also have A & AAAA records :<
[16:26:51] soahccc: nchambers: https://gist.github.com/2called-chaos/21af9c9464be7ab3cefa799764f3cbfb
[16:26:59] soahccc: so it tries v6 and then fallbacks to 4, right?
[16:28:39] soahccc: Unfortunately searching for "force ruby to use v4" doesn't yield that much
[16:30:48] soahccc: elomatreb: since I use acme client I guess I can use anything that faraday supports
[16:50:00] soahccc: Thanks guys :) I use patron now. I wouldn't bet on it but I think the old way broke after a dist-upgrade or something.

2017-12-06

[20:31:14] soahccc: *.net *.split
[20:47:57] soahccc: has joined #ruby

2017-12-01

[02:28:37] soahccc: has joined #ruby

2017-11-30

[10:09:59] soahccc: *.net *.split
[10:15:25] soahccc: has joined #ruby

2017-11-21

[14:52:39] soahccc: Ping timeout: 246 seconds
[14:58:14] soahccc: has joined #ruby

2017-11-09

[02:49:36] soahccc: Ping timeout: 248 seconds
[02:56:29] soahccc: has joined #ruby

2017-10-21

[11:12:50] soahccc: has joined #RubyOnRails

2017-10-06

[02:08:12] soahccc: Ping timeout: 260 seconds
[02:13:23] soahccc: has joined #ruby

2017-10-05

[14:50:54] soahccc: I'm a bit confused right now, the new_framework_defaults.rb is supposed to be deleted if you have migrated, no?
[14:51:37] soahccc: I'm currently on 5.1 and my belongs_to defaults to optional: true
[14:58:07] soahccc: And this lead to a strange behaviour (which isn't that strange but it's new?) that if the belongs_to is optional, the reverse has_many(dependent: :destroy) doesn't destroy anything...
[14:58:57] soahccc: And I just readded the new_framework_default file and especially the setting `Rails.application.config.active_record.belongs_to_required_by_default = true` and yet, belongs_to is optional by default...

2017-10-04

[00:14:33] soahccc: has joined #RubyOnRails
[14:03:26] soahccc: has joined #ruby
[14:50:03] soahccc: has joined #RubyOnRails

2017-10-01

[18:27:32] soahccc: has joined #ruby

2017-09-26

2017-09-21

[12:13:10] soahccc: What is the cleanest way to rescue from/handle AbstractController::ActionNotFound exceptions? It seems that you either have to hack the process method or use a middleware :/

2017-09-19

[11:41:34] soahccc: Any idea what could cause multiple threads to never run again after getting stopped? e.g. Thread.stop and then later thr.run or wakeup and it will stay on stop forever
[11:46:20] soahccc: I had no problem when not stopping the threads but I need the fiber variables to be set before the thread runs and need it available outside the thread immediately. So I stopped it, set the variables outside the thread and start it again. It has the variables and methods I defined but it wont start (rarely I get one to run). I assume a locking issue but there is no locking going on at this point. Dunno how to debug this
[11:58:03] soahccc: Burgestrand: I can show you the method I use to create the threads, the app itself is rather complex and it's some timing issue (when I sleep (line 27) or block another way the problem goes away). Also if a thread decides to run, it's not always the same one... https://gist.github.com/2called-chaos/9865817178b1dd208885b9441fae3243
[11:59:47] soahccc: Burgestrand: I switched from not-stopping and defining the fiber variables inside the Thread.new{} to stopping it and define those variables in the creating thread (as I had issues with the thread not being run yet, hence variables not being there
[12:00:23] soahccc: Burgestrand: it does #run all of the threads though, that I figured
[12:00:36] soahccc: also tried wakeup since I don't get the difference really
[12:02:50] soahccc: Burgestrand: hmm :/ didn't see the wood for the trees I guess
[12:04:00] soahccc: It seems that I can't get around a sleep in that case, even the example sleep(0.1) until thr.status == "sleep"
[12:07:07] soahccc: Burgestrand: yeah I was just looking at Mutex (which I personally don't like as much since Monitor is "reentrant"?) but do you mean a 2-way handshake? Like spawning thread waits for new thread to reach the wait, then do setup and ping back?
[12:11:31] soahccc: Burgestrand: 1st: thank you :) that works and is quite neat (I just thought about mutex but queue is just what I need)
[12:12:58] soahccc: 2nd: It might not be the cleanest architecture but I have a few status displays which obviously sleep for a while between redrawing/calculating. I had the idea of using conditional variables instead so that they behave like a sleep but can be interupted by a signal from elsewhere. Now if the thread hasn't run yet and I try to use it's fiber variable monitor => boom
[12:13:50] soahccc: So I wanted the thread to be "fully ready" before it runs and before the spawning method returns
[12:15:00] soahccc: But from what I gathered you work with threads and stuff from time to time? I bet you get a stroke when looking at my app then =)
[12:17:31] soahccc: So GUI stuff on mobile?
[12:17:54] soahccc: hehe gotcha :)
[12:19:40] soahccc: My first major app that heavily used threads was a process wrapper (for a game) to provide IRC-bot like features, now I'm creating a tool from hell to selectively pull production DB data to dev/staging systems, hence db_sucker :D
[12:21:07] soahccc: It's totally unnecessary but I have my fun with it (reworked it with a curses display)
[12:23:05] soahccc: Oh and I created poor-mans IDS with ruby once... hell this is running forever now, almost forgot about it... https://i.imgur.com/com5eRZ.jpg
[12:23:18] soahccc: longest running ruby app of my life :D
[12:25:11] soahccc: well I used it to heuristically (captcha)ban malicious hosts and I guess there are better solutions for this but where's the fun in that :D
[12:27:26] soahccc: yeah thanks I know about it but never used it so far, maybe for my next project :) has some nice stuff in it but my current tool has technically no dependencies (net-ssh/sftp and since it was removed from ruby curses)
[12:36:09] soahccc: depesz: depends on how sophisticated the target page is, you can just get away with httparty (though it handles cookies, I'm not so sure about more complex stuff) or you could go full try-hard and use a selenium integration with capybara (ususally for testing) or something
[12:36:30] soahccc: the latter can do JS and everything depending on the adapter
[12:37:39] soahccc: depesz: keep track as in keep track or rather "should just be handled for me"
[12:38:35] soahccc: then I guess httparty should be your friend, it handles things like session cookies and keeps them on redirects but if you want to login or something it can become a little bit harder
[12:39:23] soahccc: depesz: but looking at mechanize this is more something like capbara (things like "go to that form", "enter this there", "click on this and that")
[12:40:36] soahccc: depesz: http://bundler.io/
[12:41:21] soahccc: This is basically so "core" I wonder why it's still not shipped with ruby :D
[13:05:25] soahccc: nobitanobi: It's annoying I know but just "class" is a keyword
[13:06:14] soahccc: nobitanobi: you _could_ (but it's not a convention I guess) define a little helper method like def klass; self.class; end

2017-09-10

[17:16:18] soahccc: I'm trying to write a little class which basically wraps an array and allows me to #gets on it from another thread. First I would like to know if something is inherently wrong with this and second, what would be the best way to "carry over" the newly added data from line 29 to 75... https://gist.github.com/2called-chaos/23e924c35e4010d6a140863be508741d

2017-09-08

[12:26:15] soahccc: Hmm any idea on how to "gracefully" kill a net-sftp download? It seems to work event based and due to the chunked nature doesn't use blocks. If I just kill the thread if would have open handles, right? Unfortunately the #abort! method on the downloader seems to do nothing (and I don't understand why)
[13:19:13] soahccc: I build a tool that automates a few things and does so over SSH (net-ssh). It's working fine but I wonder what the easiest way would be to interrupt commands that are executing. Had no luck with trying to send ctrl-c sequence via send_data so I guess I need to find PID somehow and send signal?
[13:21:15] soahccc: hmm that makes sense, unfortunately there seems no easy way to get the pid :<
[13:21:56] soahccc: define external? I call mysqldump and gzip
[13:22:40] soahccc: fork net-ssh?
[13:29:50] soahccc: dminuoso: couldn't I just wrap my command in "bash -c '#{cmd}'" and then send ctrl-c? :< and is `send_data("\C-c")` actually correct?
[13:35:16] soahccc: TastyTrout: I was just thinking about something like this by doing some magic with $cmd & echo $! && fg
[13:36:18] soahccc: well I have a lot of those in parallel
[13:37:53] soahccc: I mean at the end of the day it's working and when I ctrl-c it will abort inbetween each step. It's just that a step can take quite some time. But I thought it would be as easy as closing the channel but it will wait for the command :(
[14:25:52] soahccc: TastyTrout: what was your idea about that shell function?

2017-09-07

[20:59:32] soahccc: What is the way to go to calculate transfer speeds? I would say the easiest way (not really accurate with ruby though) is to use a thread+loop+sleep(1) and then check how much was received
[22:06:20] soahccc: Caerus: We use some magic @body_class variable (from controller or view) in layout to add classes to body to then address it in our app.css but if that is the best way I don't know :D
[22:44:13] soahccc: Caerus: The thing is that your layout renders last and it shares @variables with all controllers/views involved
[22:44:45] soahccc: you could also use content_for for stuff
[22:45:37] soahccc: hmm ruby doesn't seem to lookup in the scope of the target when doing target.instance_exec... no chance?
[22:51:58] soahccc: Caerus: I personally like arrays for things like that or even a little helper class to increase expressiveness. And makes it modular :)

2017-09-06

[09:32:56] soahccc: Does anyone use capybara-webkit with qt4.8? It says that next major version will require qt5 but I should be fine? The thing is that clicking on things doesn't appear to work at all right now :( I had it working a year ago though so I'm guessing an capybara-webkit update made it stop working with qt4

2017-09-05

[14:15:50] soahccc: has joined #RubyOnRails

2017-09-04

[17:37:35] soahccc: I try to get into testing (finally) and I tried to recycle some old attempts. I found the following code which appeared to stopped working with some rspec update (I just updated all testing gems). Any idea on how to do it nowadays? https://gist.github.com/2called-chaos/3710369f93771230f7416b1d4a34befd#file-spec_extensions-rb
[18:38:25] soahccc: *.net *.split

2017-08-14

[23:51:23] soahccc: *.net *.split
[23:56:32] soahccc: has joined #RubyOnRails
[23:56:34] soahccc: has joined #ruby

2017-07-14

[14:53:51] soahccc: has joined #ruby
[14:53:51] soahccc: has joined #RubyOnRails
[15:00:56] soahccc: has joined #ruby
[15:00:56] soahccc: has joined #RubyOnRails
[15:04:00] soahccc: Client Quit
[15:08:22] soahccc: has joined #ruby
[15:11:08] soahccc: Client Quit
[15:11:42] soahccc: has joined #ruby
[15:27:09] soahccc: has joined #ruby
[15:29:29] soahccc: has joined #RubyOnRails
[15:29:41] soahccc: Client Quit
[15:30:05] soahccc: has joined #ruby
[15:31:26] soahccc: has joined #RubyOnRails
[15:34:03] soahccc: Hey guys, is there a maximum version of mysql2 for activerecord? It throws me the "add mysql2 to your gemfile" but it is there... I dont get it
[15:36:49] soahccc: dminuoso: well I guess it's a 4.1 project without spring but yeah I bundled. The thing is that I updated my server and I suddenly got "uninitialized constant Mysql2::Client::SECURE_CONNECTION" so I updated the mysql2 gem and now it tells me to add it to the gemfile
[15:38:42] soahccc: Okay 0.4 was to recent I guess. It breaks with 0.3.16 and works with 0.3.18 so I guess that works for me :)
[15:42:14] soahccc: dminuoso: I think they improved the errors with rails 5, no? I think they now tell you what the version should be

2017-07-06

[05:22:24] soahccc: Ping timeout: 240 seconds

2017-06-20

[00:17:38] soahccc: *.net *.split
[00:22:41] soahccc: has joined #RubyOnRails
[00:23:12] soahccc: has joined #ruby

2017-06-05

[10:26:44] soahccc: Anyone can recommend a good way for large file uploads? I'm currently fiddeling with nginx and saving body to file / not passing it to backend and that works but requires patching of Rack and I now have to parse out the actual file and I think there must be a better way
[21:28:15] soahccc: Can someone tell me how the establish_connection thing is supposed to work? if you do establish_connection(:foo) how must the key be named in database.yml? Because it tells me everytime that the database configuration does not specify an adapter but it does, it doesn't tell what it's looking up though.
[21:30:18] soahccc: oh that was easy, I passed it as string accidentally but it must be a symbol :/
[21:33:09] soahccc: It happened because I was interpolating the rails env but funnily if you pass something that doesn't exist it tells you that and lists you available configs... if you pass a string it just fails :D
[23:21:38] soahccc: Hmm what is the most direct way from a model to execute raw sql?
[23:22:09] soahccc: I suppose it's just Model.connection.execute right?
[23:22:50] soahccc: I have a table without ID or anything (but I can't change it) and delete goes apeshit :D
[23:28:49] soahccc: hmm connection.execute can't even prepare :/ I totally expected that

2017-06-03

[10:58:13] soahccc: I'm feeling stupid, this query worked in another project but now that I use it in another one it doesn't. I must be missing something obvious but what? https://gist.github.com/2called-chaos/86247a0f3877cc854a2bf676d1e15a1f
[11:02:07] soahccc: Hmm I guess it's broken generally if those values are null... da hell
[11:07:51] soahccc: Okay I have to check for NULL explicitly, I never knew that.
[13:47:42] soahccc: I'm trying to deploy with newly added acts_as_taggable_on integration. Mysql locally and in production but in production it can't run the migrations with a (stupid?) error. Anyone knows what's up with that? https://gist.github.com/2called-chaos/d6ff571494b192f512754059cfbd9722
[13:50:24] soahccc: well the screenshot is kinda irrelevant I just noticed but "index_tags_on_name" is < 767 bytes or am I retarded?
[15:26:54] soahccc: I know it's dirty but it works perfectly. With MySQL you can query different databases with the same connection, unfortunately it doesn't quite work if I put it into table_name. Any idea on how to hack it in?
[22:07:11] soahccc: k13nox: it uses redis as it's "brain" so yeah it should
[22:08:20] soahccc: Did anyone managed to find a good solution to large file uploads with nginx infront of your app? I technically found a way but it's very hard to workaround the implications in terms of showing the user any sort of validation errors

2017-06-01

[11:49:41] soahccc: has joined #RubyOnRails
[11:53:55] soahccc: I'm trying to understand why a request takes so long. Is there anything exceptionally special about dev-mode to take into account? I mean it's slower in general but as long as I compare warm-requests (first request after change takes longer) it should be representative?
[11:56:07] soahccc: workmad3: yeah thats true but the issue I'm having is to figure out where the overhead of the first _comments partial is coming from: https://gist.github.com/2called-chaos/b3f208e3c3c807c29135802afa05d705
[11:56:44] soahccc: it's not the pagination and not the present() call and all the child renders combined there are 200ms out of nowhere
[11:57:57] soahccc: workmad3: you mean in line 1? It should only load the records if I'm using it right? That would be in the benchmark (as present does an each on the collection)
[11:58:04] soahccc: and it's not that, it takes only 10ms
[11:59:18] soahccc: workmad3: but it would reflect here right? forgot to add that to the log: Completed 200 OK in 407ms (Views: 355.0ms | ActiveRecord: 12.6ms)
[11:59:38] soahccc: wasn't the same request but AR is always very small amount
[12:00:08] soahccc: the thing is that due to a lot of permission related stuff it's very hard to cache this and it's as slow in production
[12:05:40] soahccc: workmad3: you say the SQL tracing is not that good, but I should see all the individual queries in the output or are there some missing as well?
[12:09:49] soahccc: get concatenated at this point?
[12:09:49] soahccc: workmad3: I know that the view is kindof dirty :> But it's not the present method (and at least main entry query) since I output the realtime it takes and it's ~10ms. I mean it's only 7 entries. and it takes up to a second to render and SQL never seems to be an issue. It would also reflect in the child-renders as I often have more childrens than root-comments. I was just wondering where the overhead is coming from, maybe internally the outputs
[12:19:03] soahccc: I tried it with rack mini profiler and I do have a few more queries in the long-taking render but the SQL time is 1.2ms and you can usually count the records fetched with your hands, nothing that would take 200ms
[12:41:34] soahccc: workmad3: oh you mean for the user? I just commented out basically everything and I figured that calling render seems to increase the runtime of the parent partial by a good amount at least according to mini profiler
[12:42:40] soahccc: workmad3: if I remove both render calls it's sane, using either render call drastically increases the time for the parent but I don't know why, I even printed everything I passed to the partial so it's not that
[12:43:06] soahccc: is there are performance thing if you call the same partial you are in or something? it's weird. also only on the first level
[12:54:40] soahccc: workmad3: I know that render has some weight to it but it should be for every call no? I can pm you a link to the profiling result if you have a minute.

2017-05-31

[09:01:06] soahccc: *.net *.split

2017-05-25

[12:10:40] soahccc: We made a somewhat bad decision back in rails 4 when we added a getter method price returning a object while having a DB column with the same name. In rails 4 it never was a problem but when we migrated to rails 5 we had to add a to_s method as the forms were screwed. Everything else seems to work.
[12:11:59] soahccc: Now the problem: We have a numericality (gt > 0) validator on the price and it works always, for everyone but THAT one guy raises exceptions of the following: "undefined method `>' for #<Product::Price:0x007f1088c128d0>"
[12:12:37] soahccc: I mean I could add that method to the object as well but how does he do that, I'm unable to reproduce it and there was nothing fishy about the price he submitted
[12:33:00] soahccc: I digged a bit into the validator and I think the only way this happens is if attribute_changed_in_place? returns true but I can't really figure out what could possibly cause something like that. Any ideas?
[13:22:02] soahccc: francuz: what kind of backup are we talking about? Frequency, DB size.
[13:23:27] soahccc: I personally do dumps from a slave and compress&upload them to a server with more storage
[13:24:55] soahccc: francuz: we do dumps every 15 minutes with 3-5 GB xD you should be fine
[13:25:39] soahccc: 2017-05-24 130.8 GB younger than 7 days, keep all
[13:27:23] soahccc: francuz: well the best way are snapshots imho but the reason for this is speed/DB locktime
[14:03:06] soahccc: Haha I figured out my validation error :D validation attempts to use raw_value (dirty attribute) and if the product get saved multiple times (e.g. updated_at changes through touching relations) the raw_value gets purged and only then it calls the accessor...
[14:51:39] soahccc: daveomcd: I guess you bundle per app? I bundled manually with a different path and then replaced the directory with an app restart, I did that when I updated ruby
[15:02:47] soahccc: Anyone using letsencrypt with a ruby client by chance? Apparently the client I use doesn't work with ubuntu's shipped openssl version :(

2017-05-24

[11:53:25] soahccc: I just tried to work with activejob for the first time... Can someone explain to me why this happens to "cids"? I even tried renaming it but there is some magic I don't get and it drives me crazy... https://gist.github.com/2called-chaos/dcf92f1594190bf01168e239720e54a7
[12:02:32] soahccc: oh my... this indeed it total black magic in the serializer?!? It 100% is just a plain old string but in deserialization it SOMEHOW detects it being a base64 encoded GlobalID and converts it, adding a random character stops that.... wat?
[12:05:45] soahccc: tbuehlmann: I'm just listing cable "handles" (not connections really) and I was about using cable to display them so I put the connection_identifier in there
[12:06:17] soahccc: Basically I did the hello world by listing the cable handles (per user in that case)
[12:07:56] soahccc: so is it basically trying to decode64 + regex matching it in order to detect these strings or what? This totally buffed me since I clearly put a string with "random" characters in and get a total strange and unexpected object back, thats all :)
[12:14:39] soahccc: It is as if nobody thought about someone wanting a "how many connections am I having" insight, all there is are per process values

2017-05-23

[11:38:45] soahccc: yeah I'm ashamed to out me as mysql user :<
[11:39:39] soahccc: oh the memories
[11:43:40] soahccc: Yeah I thought that it's a little bit messy. I guess the ultimate goal would be that rails "understands" the error returned and instead of going apeshit adding a "failed validation state". But generally at validation time AR knows these things (e.g. it does SQL to satisfy uniqueness validation)
[11:44:33] soahccc: Theoretically I could do it per-instance with after_initialize callback but I guess that's not very clean either
[11:45:17] soahccc: The thing is just that we have a few models with a lot of strings and I have the option of a lot of lines or a very long line for the length validation :/
[15:49:07] soahccc: I'm playing a bit with actioncable and I wonder: how do you properly secure streams? Are the keys I pass to stream_from known to the user or can the user tamper with them?