Activity Graph

Page 1 of 250 | Next »


[15:50:39] jhass: LinuxKnight: why is it inside a loop if it should run only once?


[10:30:06] jhass: who does, they all pretend :P
[10:31:31] jhass: a blockchain, technically not the buzzword, is just a data structure
[10:31:49] jhass: would you ask "has ruby a place on the field of binary trees"?
[10:34:11] jhass: well, look harder :P
[10:36:17] jhass: https://rubygems.org/search?utf8=%E2%9C%93&query=blockchain / https://crates.io/search?q=blockchain / http://crystalshards.xyz/?filter=blockchain / https://metacpan.org/search?q=blockchain and so on
[12:44:02] jhass: just ask and stick around for an hour or two, if anybody is available with an answer to your question, they'll respond
[13:08:00] jhass: Cork: why can't you prevent it from being set in the first place?
[13:14:46] jhass: Cork: but I mean it's all your code that calls it, no?
[13:16:18] jhass: mh, I guess I'd consider just doing my own flag and doing consistent state with an after_save callback
[13:17:54] jhass: maybe there's something wrong in the data model, actual terms would help thinking about that point :)
[13:18:55] jhass: dachi: maybe it would be simpler if you use the same session but different keys within the session?
[13:20:55] jhass: no, I mean instead of using idk, "current_user_id", for the system. part use "current_system_user_id" etc
[13:28:04] jhass: does your admin thing even share much domain logic? maybe it could be its own thing?
[13:28:12] jhass: own app that is
[13:41:49] jhass: maybe you have some luck with deriving your own session store from ActionDispatch::Session::CookieStore and overriding load_session/delete_session to reset options[:key] based on the host in req
[13:44:01] jhass: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb / https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb / https://github.com/rack/rack/blob/master/lib/rack/session/abstract/id.rb#L202
[13:44:47] jhass: so @key not options[:key]
[16:48:13] jhass: huh, I would think the monkey patch is unecessary/avoidable
[16:48:41] jhass: especially since your custom store redefines one of the redefined methods again
[16:50:16] jhass: yes, CookieStore inherits Peristed
[16:51:00] jhass: so I would imagine just overriding extract_session_id in your custom store is enough
[16:51:57] jhass: not sure how I feel about copying implementation vs just setting @key and calling super, both is hackish but I think personally I'd prefer calling super


[14:19:11] jhass: yes, that's very sad indeed
[14:19:15] jhass: btw ruby has no functions
[15:07:30] jhass: just ask your question and stick around for a couple of hours, if anybody can answer they will ;)


[13:38:34] jhass: maybe something else defines a file called active_record.rb and gets priority now? dump $LOADED_FEATURES directly after the require and check the path
[13:45:12] jhass: johnaj: call redo
[13:49:24] jhass: extension = rails engine?
[13:51:07] jhass: https://guides.rubyonrails.org/engines.html#testing-an-engine
[14:08:43] jhass: that's interesting, I couldn't even find a single thing they have in common
[14:09:24] jhass: from its description "The Listen gem listens to file modifications and notifies you about the changes"
[14:09:32] jhass: what's unclear about that?
[14:10:49] jhass: no, not at all
[14:11:50] jhass: when you do git status, git compares what's in your working copy vs what's the state of HEAD
[14:12:14] jhass: listen hooks the OS to get notified when a file was written
[14:12:18] jhass: very different things
[16:41:11] jhass: like for the sake of it?
[16:42:09] jhass: essentially, the distinction between a block and a proc is that the block is fully anonymous
[16:42:19] jhass: you can make a recursive proc
[16:42:58] jhass: x = -> { x.call }
[16:44:17] jhass: you can make a method that yields a given block as a proc to itself: def x(&block); yield block; end; x {|y| y.call(y) }
[16:44:24] jhass: I never needed any of that in the real world
[17:07:49] jhass: write the data to data- attributes and write a generic click handler in our of your .js files
[17:08:43] jhass: eh, I mean *one
[17:31:41] jhass: I think I'd just make sure it's a string and only contains characters your token generator may produce
[17:32:17] jhass: cheap and easy
[17:33:03] jhass: /\A[a-f\d]+\z/ or whatever it is
[20:03:47] jhass: tbh with that little info and if dropping and recreating the test db doesn't help, I'd pull out wireshark and snoop on the mysql connection to see if that shows some error message


[02:44:11] jhass: Ping timeout: 260 seconds
[02:46:21] jhass: has joined #RubyOnRails
[02:46:22] jhass: has joined #ruby-offtopic
[02:46:22] jhass: has joined #ruby
[03:26:15] jhass: Ping timeout: 252 seconds
[03:33:24] jhass: has joined #RubyOnRails
[03:33:25] jhass: has joined #ruby-offtopic
[03:33:25] jhass: has joined #ruby


[01:49:07] jhass: *.net *.split
[01:58:12] jhass: has joined #ruby-offtopic
[01:58:12] jhass: has joined #ruby
[01:58:12] jhass: has joined #RubyOnRails


[10:28:38] jhass: Quit: Bye
[10:28:51] jhass: has joined #ruby-offtopic
[10:28:51] jhass: has joined #ruby
[10:28:51] jhass: has joined #RubyOnRails


[19:12:42] jhass: has joined #ruby-offtopic
[19:12:42] jhass: has joined #ruby
[19:12:42] jhass: has joined #RubyOnRails


[22:18:26] jhass: Ping timeout: 255 seconds


[00:07:17] jhass: *.net *.split
[00:15:27] jhass: has joined #RubyOnRails
[00:15:43] jhass: has joined #ruby


[07:43:06] jhass: Quit: Bye
[07:46:40] jhass: has joined #ruby
[07:46:40] jhass: has joined #RubyOnRails


[11:42:25] jhass: Ping timeout: 256 seconds


[02:24:42] jhass: Quit: Bye
[02:47:09] jhass: *.net *.split
[02:47:44] jhass: has joined #RubyOnRails
[02:47:54] jhass: has joined #ruby


[09:07:56] jhass: Ping timeout: 256 seconds
[09:30:17] jhass: has joined #ruby
[09:30:17] jhass: has joined #RubyOnRails


[18:20:51] jhass: Quit: Bye
[18:34:46] jhass: has joined #ruby
[18:34:46] jhass: has joined #RubyOnRails


[08:05:40] jhass: so it's a call to + and a call to to_proc on the result of that call
[08:09:30] jhass: ahly: that's because + is binary +, so it expects an argument. unary + is actually called +@, so 3.+@.to_proc (which thenn fails because numbers don't actuallly have a to_proc)
[08:42:47] jhass: mikhael_k33hl: you want to check whether a process exists?
[08:46:29] jhass: mikhael_k33hl: is it a child process of your process?
[08:47:53] jhass: Process.kill(0, pid) seems to work for me
[08:48:47] jhass: it's running
[08:49:11] jhass: try a not existing pid or one you have no permissions to, you'll get respective exceptions


[18:23:33] jhass: Radar: nope, just got lucky to get my PR merged


[12:25:52] jhass: *.net *.split
[12:27:26] jhass: has joined #ruby
[12:27:35] jhass: has joined #RubyOnRails
[15:01:23] jhass: *.net *.split
[15:03:02] jhass: has joined #RubyOnRails
[15:03:10] jhass: has joined #ruby


[20:19:02] jhass: "one large class that holds everything" is rarely a good idea ;)
[20:19:46] jhass: how that class is initialized and called is quite irrelevant in general
[20:56:14] jhass: there are plans to do it for ruby 3 afaik
[21:00:51] jhass: check crystal :P
[21:08:20] jhass: could you press enter less? thanks
[21:09:59] jhass: you'll love java
[21:11:36] jhass: do Fortran!
[21:13:55] jhass: what if I want to serialize to YAML? Protobuf? Messagepack? My own custom encoding?
[21:14:21] jhass: actually not, you're mixing concerns
[21:15:16] jhass: a serializer should know datatypes and conversions, not the datatype should know its serialzations and conversions
[21:15:30] jhass: since it's much easier to hook custom converters into a serializer
[21:15:38] jhass: than into each and every possible datatype
[21:18:10] jhass: I think we all got it, thanks
[21:18:52] jhass: how about you write a blogpost and post it to rubyflow or whatever instead of spamming this channel?
[21:19:30] jhass: ok, so why do you tell us?
[21:19:41] jhass: why not keep it for yourself then?
[21:20:23] jhass: it's not, seen it a lot in java. was a pain to use
[21:21:52] jhass: please stop
[21:35:44] jhass: there's #ruby-offtopic for that kind of stuff ;)


[09:34:48] jhass: *.net *.split
[09:36:30] jhass: has joined #ruby
[09:36:32] jhass: has joined #RubyOnRails


[12:13:00] jhass: if you want to do that to speed it up, that won't help since there's no way to tell without reading the entire file
[12:16:50] jhass: good luck seeking to the beginning of a line without wasting any time gained by that
[12:30:02] jhass: I see I'm done here :P


[14:25:46] jhass: skinux: how did you install ruby and what's your OS? Also could you amend the gist with the output of gem env?
[14:28:07] jhass: which repo?
[14:28:24] jhass: ah nvm the official one
[14:29:19] jhass: do you have a /usr/bin/rake as well?
[14:30:13] jhass: could you try just deleting /usr/local/bin/rake?
[14:31:20] jhass: now the error should be gone or at least the output should be different
[14:39:27] jhass: what exactly is the error message?
[14:40:32] jhass: skinux: so something is referring explicitly to that? could you maybe provide some more context into what you're doing/running?
[14:41:15] jhass: what if you run /usr/bin/rake explicitly?
[14:43:05] jhass: skinux: is there a Gemfile next to the Rakefile?
[14:43:28] jhass: ah, so ancient rails app I guess
[14:43:46] jhass: activesupport 2.3 is really really old
[14:43:52] jhass: not sure it'll even work with ruby 2.3
[14:45:02] jhass: not really, I'm not into CMSes, sorry. The little needs into that direction I have I solve with static site generators
[14:45:31] jhass: https://github.com/markets/awesome-ruby#cms here's a list of ruby based ones
[14:46:49] jhass: morfin60: why do you have a unix timestamp that's not in UTC?
[14:46:55] jhass: usually they all are
[14:47:19] jhass: so for 1516208400 2018-01-17 20:00:00 +03:00 would be correct
[14:48:46] jhass: dminuoso: because they're counting from 1970-01-01 00:00:00 UTC, so in practice they're seconds since that in UTC
[14:49:41] jhass: morfin60: so far that's very expected
[14:50:56] jhass: morfin60: so you're saying your DB is incorrectly assuming the date you give it (in whatever way) is UTC?
[14:51:28] jhass: while it's localtime, which in your case is +0300?
[14:55:14] jhass: prutheus: no idea about the particular lib you're using, but in general the first thing I would try is giving an array as the value
[14:57:34] jhass: write a better client lib :P
[14:58:59] jhass: morfin60: easiest might be to make sure to work with UTC dates everywhere possible and only convert to localtime at presentation
[14:59:55] jhass: so calling .utc in your parsed dates and .localtime before display
[15:02:15] jhass: banisterfiend: nice one
[15:02:30] jhass: how do you do that in the background? ctags db?
[20:21:16] jhass: tetraktys: why not a method or a scope?
[20:22:33] jhass: note that a scope is pretty much just a fancy way to define a method that should return a relation
[20:24:38] jhass: I think to query all images and know the primary one with one query (doing it separately is just two queries still, not n+1) you have to order by priority and pick the first
[20:25:21] jhass: that means you can't have the rest in another order (without sorting on the application side that is, which probably would be slower than just two queries)
[20:26:01] jhass: why would you need to?
[20:26:45] jhass: maybe I missed where you explained what your actual goal is :P
[20:27:35] jhass: do you want all images + the primary one for a list of products, or just the primary one per product?
[20:31:00] jhass: not sure you can properly express the needed join with AR, maybe with arel but I'd probably just opt for some raw SQL there


[01:52:29] jhass: Ping timeout: 276 seconds
[01:57:17] jhass: has joined #ruby
[01:57:17] jhass: has joined #RubyOnRails


[17:46:05] jhass: idk, now let's continue to enjoy the silence
[18:12:14] jhass: great, cya!


[20:52:45] jhass: adaedra: still up?
[20:53:05] jhass: already in berlin?
[20:54:06] jhass: so, watcha doing in berlin and where are you staying?
[20:54:57] jhass: hah, that's not too far from where I live but not too close to where I work :D
[20:55:22] jhass: how long do you stay?
[20:57:10] jhass: so maybe dinner?
[21:03:20] jhass: same for me
[21:03:56] jhass: nothing planned so far on either day ;)
[21:04:40] jhass: I guess just shoot me a mail when you have time and where you are and I'll figure a location :)
[21:05:12] jhass: me@jhass.eu
[21:05:24] jhass: or if there's anything I can just join that's fine too ;)
[21:06:32] jhass: sounds good
[21:07:01] jhass: how does korean sound?
[21:07:37] jhass: then finding a bus from potsdamer platz to kleistpark should be easy and we'll meet there
[21:07:52] jhass: just give me a 10min heads up on when
[21:20:01] jhass: alright, cya tomorrow o/
[21:21:28] jhass: oh, or the day after what ever fits you better ;)


[21:39:14] jhass: is there even a system call for that?
[21:41:29] jhass: ah, you can just pass that interface's IP to TCPSocket.new
[21:42:05] jhass: or can you? nvm -.-
[21:43:34] jhass: ah, but looks like Socket.tcp takes that option
[21:47:41] jhass: not sure I have ancestors among the Teutonen, how would you even check that
[21:47:46] jhass: all good otherwise ;)
[21:48:41] jhass: yeah just googled that, since I never heard it before xD
[21:48:58] jhass: but turns out that's just a generalization the romans made
[21:49:13] jhass: https://en.wikipedia.org/wiki/Teutons
[21:50:43] jhass: craysiii: now the challenge is finding an HTTP client which lets you construct the socket yourself I guess
[21:53:48] jhass: wouldn't be surprised if it'll be your best bet at the end tbh
[21:59:03] jhass: looks like httpclient has the option too, but it's all ruby so no idea what would be the point of using it over net/http
[22:12:35] jhass: okay, I see localport and localportrange and actually an interface option in typheous (well, ethon)


[18:44:38] jhass: adaedra: sounds great
[18:44:56] jhass: you don't have jabber/xmpp by chance? :P


[03:30:06] jhass: *.net *.split
[03:31:07] jhass: has joined #ruby-ops
[03:31:07] jhass: has joined #ruby-offtopic
[03:31:07] jhass: has joined #ruby-community
[03:31:07] jhass: has joined #ruby-banned
[03:31:07] jhass: has joined #ruby
[03:31:07] jhass: has joined #RubyOnRails
[03:31:07] jhass: has joined ##new2ruby
[18:08:23] jhass: adaedra: sup?


[11:10:09] jhass: prutheus: look for Marshal
[11:57:35] jhass: prutheus: no, you have to store the state, so the actual text as a string


[12:57:18] jhass: havenwood: al2o3-cr I maintain a couple of the older ruby packages but the main one is by anatol


[14:59:13] jhass: RougeT430: not sure I get the question
[20:54:00] jhass: it's good if you never really looked into the GoF patterns and take them too seriously, otherwise there's not too much to learn from it IMO
[20:54:09] jhass: eh, *or not and


[21:49:49] jhass: eh, cat ran across keyboard :P
[23:03:22] jhass: not sure I'd call `require "minitest/autorun"` that much setup
[23:04:30] jhass: sorry should have said that much more setup than what you need for py.test
[23:05:39] jhass: at the top of each file
[23:06:01] jhass: then run a file with ruby thefile.rb or all of them with a simple for loop or whatever
[23:11:02] jhass: pure preference



[22:14:15] jhass: also a screenshot of your browsers error console would be nice I guess