Synthead

Activity Graph

Page 1 of 8 | Next »

2019-06-13

[05:42:12] Synthead: has joined #ruby
[05:43:29] Synthead: I want to parse markdown and get links and their attributes to iterate through. I found redcarpet, but it seems to just convert markdown to other languages. Can I use it to simply parse markdown and read its data?
[06:28:00] Synthead: Read error: Connection reset by peer
[06:28:23] Synthead: has joined #ruby
[07:20:31] Synthead: Remote host closed the connection

2019-04-17

[22:50:33] Synthead: has joined #ruby
[23:15:02] Synthead: Ping timeout: 246 seconds

2019-03-29

[00:32:33] Synthead: Remote host closed the connection

2019-03-28

[23:40:46] Synthead: has joined #ruby
[23:41:05] Synthead: I want to use a different gcc when compiling a gem via Bundler. How can I do this?
[23:41:22] Synthead: it's in my path as gcc-7

2019-03-26

[02:28:28] Synthead: has joined #ruby
[02:28:53] Synthead: I want to modify sources for a gem and have bundle compile it as-is
[02:28:58] Synthead: Is there a way I can do that?
[03:20:03] Synthead: Ping timeout: 245 seconds
[03:41:46] Synthead: has joined #ruby
[03:54:55] Synthead: Ping timeout: 244 seconds
[17:24:20] Synthead: has joined #ruby
[17:48:25] Synthead: Remote host closed the connection

2019-03-09

[07:58:14] Synthead: has joined #RubyOnRails
[07:58:54] Synthead: I'm trying to start a basic rails app. I did a "rails new", and "rails s" shows what I expected, but when trying to load localhost, I get this:
[07:58:56] Synthead: #<LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile.>
[08:00:21] Synthead: Gemfile.lock also has sqlite3 (1.4.0) listed
[08:02:01] Synthead: well, I added `~> 1.3.6' to the Gemfile and it seems to work
[08:02:13] Synthead: Remote host closed the connection

2018-10-25

[06:31:50] Synthead: has joined #ruby
[09:01:27] Synthead: Ping timeout: 240 seconds
[09:04:27] Synthead: has joined #ruby
[09:22:18] Synthead: Ping timeout: 246 seconds
[15:14:41] Synthead: has joined #ruby
[15:17:13] Synthead: Remote host closed the connection

2018-10-24

[17:52:52] Synthead: has joined #ruby
[17:53:32] Synthead: is there a lib that'll help convert something like "200M" (a string from user input) to bytes in 200 MiB?
[18:03:07] Synthead: Filesize.from seems to do the trick! Thanks!
[18:03:09] Synthead: Remote host closed the connection

2018-09-11

[16:14:17] Synthead: has joined #ruby
[16:27:33] Synthead: I added BUNDLE_BUILD__BYEBUG='--with-cflags=-Wno-error=attributes' to my environment, and "bundle config" confirms that it's in there. However, when I run "bundle", it still raises an error when compiling byebug: https://gist.github.com/synthead/59d70a500a17f2df751dc5891b44ed63
[16:28:08] Synthead: If I cd to the byebug gem sources, edit Makefile and tack -Wno-error=attributes in there, "make" works
[16:28:11] Synthead: What am I missing?
[17:08:54] Synthead: Remote host closed the connection

2018-08-16

[05:11:32] Synthead: has joined #ruby
[05:12:29] Synthead: what are your thoughts on foo = lots + of / logic; MyClass.new(foo: foo) vs. MyClass(foo: lots + of / logic) ?
[05:27:22] Synthead: Remote host closed the connection

2018-07-31

[01:09:25] Synthead: has joined #ruby
[01:10:37] Synthead: I'm using minitest, and I want to ensure that a method gets called without actually calling the method (kinda like expect(instance).to receive(:method) in rspec)
[01:10:51] Synthead: I'm doing this (pasting as it's just three lines):
[01:10:58] Synthead: notify_mock = MiniTest::Mock.new
[01:10:59] Synthead: notifier.stub(:notify, notify_mock) {}
[01:10:59] Synthead: notify_mock.expect(:notify, nil, [])
[01:11:28] Synthead: however, the notify method still gets called when I do notifier.notify
[01:11:35] Synthead: What am I doing wrong?
[03:37:50] Synthead: Ping timeout: 268 seconds
[06:32:15] Synthead: has joined #ruby
[08:21:05] Synthead: Quit: Leaving

2018-06-01

[04:39:37] Synthead: has joined #ruby
[04:39:49] Synthead: is there a way to "force less" on an object in pry?
[04:40:00] Synthead: I want to use / on it, but it's not long enough to be piped through less
[07:26:23] Synthead: Quit: Leaving

2018-04-16

[00:28:58] Synthead: has joined #ruby
[00:30:13] Synthead: Client Quit

2018-04-15

[21:43:07] Synthead: has joined #ruby
[21:44:32] Synthead: I'm trying to send raw XML via Faraday, and the server is giving 500s where cURL'ing the same data works fine
[21:45:00] Synthead: is there some way that I have to configure Faraday to make this work? perhaps it's trying to encode the data somehow?
[22:41:47] Synthead: is there a way I can see the submitted body in faraday requests?
[23:04:35] Synthead: Ping timeout: 240 seconds
[23:14:06] Synthead: has joined #ruby
[23:37:32] Synthead: Ping timeout: 268 seconds

2017-12-08

[00:25:06] Synthead: has joined #ruby
[00:25:34] Synthead: when I do a Set.new.tap and do a little loop to add things to it, the Set comes back empty
[00:25:51] Synthead: if I stick a binding.pry in the block, I can see that the Set is being populated, though
[00:25:54] Synthead: what's going on here?
[01:16:46] Synthead: Quit: Leaving

2017-12-06

[09:42:45] Synthead: has joined #ruby
[09:43:07] Synthead: I have a VCR cassette with a 409 response in it
[09:43:27] Synthead: whenever I try to use this data for something, my test immediately raises the 409 exception
[09:44:09] Synthead: I can think of hacky rescue ways to assign that exception to a variable, but is there a better way I can do this?
[09:56:24] Synthead: Remote host closed the connection

2017-10-31

[02:30:36] Synthead: has joined #ruby
[02:32:03] Synthead: is there a way to check if n is an index of an array without doing something like n >= 0 && n < a.count ?
[02:32:31] Synthead: i.e. (making this up) s.exists?(2)
[05:35:17] Synthead: Ping timeout: 258 seconds

2017-08-16

[01:31:42] Synthead: has joined #ruby
[01:32:09] Synthead: is there a good way I can break up #( ... ) literals into multiple lines without including the newlines?
[01:32:49] Synthead: if I terminate the end of the first line with \, it works, but it also includes all the whitespaces before the text in the second line
[01:32:54] Synthead: zenspider, yeah
[01:33:02] Synthead: or sorry, %( ) literals
[01:33:51] Synthead: ehh, I'd rather not tbh, that's kinda gross
[01:34:21] Synthead: I'd prefer to use string literals because I'm using a lot of "s with interpolated strings
[01:35:02] Synthead: this is what I'm after, basically https://gist.github.com/anonymous/205bc5d76bc9ec7b72b6519dcf292d2b
[01:35:06] Synthead: this will test false
[01:35:18] Synthead: but I'm looking for the string literal magic to make it true ;)
[01:35:54] Synthead: that's just so gross :p
[01:36:40] Synthead: what if it existed already and there was an easy answer?
[01:36:57] Synthead: suppose I'm getting a "no" here
[01:37:11] Synthead: ok thanks for the help
[01:49:15] Synthead: Quit: Leaving

2017-05-27

[19:51:00] Synthead: has joined #RubyOnRails
[19:53:16] Synthead: Read error: Connection reset by peer

2017-05-26

[20:15:59] Synthead: Ping timeout: 240 seconds
[20:33:55] Synthead: has joined #RubyOnRails
[20:43:47] Synthead: Ping timeout: 240 seconds

2017-05-25

[04:04:53] Synthead: Ping timeout: 268 seconds
[18:29:06] Synthead: has joined #RubyOnRails
[19:19:04] Synthead: Ping timeout: 240 seconds
[20:43:07] Synthead: has joined #RubyOnRails
[22:45:27] Synthead: Ping timeout: 240 seconds
[23:31:24] Synthead: has joined #RubyOnRails

2017-05-24

[20:07:22] Synthead: has joined #RubyOnRails
[20:07:30] Synthead: what the correct semantic naming for a m2m table? say I have the tables "issues" and "comments". would it be "comments_issues"? Then would the model be CommentsIssue?
[20:09:14] Synthead: right, but I'm looking to make a m2m model that stores attributes about the relationship
[20:09:20] Synthead: via through
[20:09:51] Synthead: unless there's a better way :)
[20:10:07] Synthead: ah, good :)
[20:10:15] Synthead: it seems a little hokey to name a model CommentsIssue
[20:12:06] Synthead: that's an interesting thought
[20:12:17] Synthead: I suppose the plural is a good indicator that it's a m2m
[20:12:26] Synthead: in a smelly way :D
[20:12:53] Synthead: I try to use conventions as much as possible
[20:12:57] Synthead: makes it easier to read
[20:13:05] Synthead: I'll go with CommentsIssue
[20:13:08] Synthead: thanks so much!
[22:15:39] Synthead: Ping timeout: 260 seconds
[22:59:12] Synthead: has joined #RubyOnRails

2017-03-31

[20:07:33] Synthead: Remote host closed the connection

2017-03-28

[22:46:10] Synthead: has joined #RubyOnRails
[22:46:11] Synthead: has joined #ruby

2017-03-27

[17:39:56] Synthead: Read error: Connection reset by peer

2017-03-21

[21:36:30] Synthead: has joined #ruby
[21:36:30] Synthead: has joined #RubyOnRails

2017-03-13

[18:38:44] Synthead: Remote host closed the connection

2017-03-07

[23:27:33] Synthead: has joined #ruby
[23:27:33] Synthead: has joined #RubyOnRails

2016-07-31

[00:02:36] Synthead: Ping timeout: 276 seconds
[00:16:12] Synthead: has joined #RubyOnRails
[00:16:12] Synthead: has joined #ruby
[00:37:03] Synthead: Ping timeout: 276 seconds
[00:42:24] Synthead: has joined #RubyOnRails
[00:42:24] Synthead: has joined #ruby
[00:59:09] Synthead: Ping timeout: 276 seconds
[01:00:25] Synthead: has joined #RubyOnRails
[01:00:25] Synthead: has joined #ruby
[01:06:57] Synthead: Ping timeout: 276 seconds
[01:19:33] Synthead: has joined #RubyOnRails
[01:19:33] Synthead: has joined #ruby
[17:24:33] Synthead: Ping timeout: 276 seconds
[17:37:49] Synthead: has joined #RubyOnRails
[17:37:49] Synthead: has joined #ruby

2016-07-30

[19:05:33] Synthead: Ping timeout: 276 seconds
[19:19:13] Synthead: has joined #RubyOnRails
[19:19:13] Synthead: has joined #ruby
[19:26:21] Synthead: Ping timeout: 276 seconds
[19:39:01] Synthead: has joined #RubyOnRails
[19:39:01] Synthead: has joined #ruby
[21:05:09] Synthead: Ping timeout: 276 seconds
[21:18:25] Synthead: has joined #RubyOnRails
[21:18:25] Synthead: has joined #ruby
[21:55:12] Synthead: Ping timeout: 276 seconds
[22:08:39] Synthead: has joined #RubyOnRails
[22:08:39] Synthead: has joined #ruby
[23:08:00] Synthead: Ping timeout: 276 seconds
[23:13:34] Synthead: has joined #RubyOnRails
[23:13:34] Synthead: has joined #ruby

2016-07-27

[09:34:18] Synthead: Ping timeout: 276 seconds
[09:47:52] Synthead: has joined #RubyOnRails
[09:47:52] Synthead: has joined #ruby

2016-07-21

[19:40:35] Synthead: I'm building a docker image with passenger in it, and I'm putting passenger-install-nginx-module in the Dockerfile. I want to keep the image size small, so it'd be great to delete the downloaded files, the sources it compiled from, etc. Is there a supported way to do this, or should I just rm -r some of the directories in /usr/lib/ruby/gems/2.3.0/gems/passenger-5.0.29?

2016-07-20

[22:03:00] Synthead: is there a way I can have rails read from config/ as well as an additional arbitrary directory?
[22:07:29] Synthead: jhass: when rails starts, it reads configuration from config/, you know
[22:08:16] Synthead: I'm looking to put some additional configs in an arbitrary directory
[22:08:47] Synthead: I am building a docker container for a rails project, and it would be really nice to put conf files with passwords, etc. in a volume
[22:09:12] Synthead: there are some tracked files in config/ (like most projects), and some that aren't (with .example files provided)
[22:09:55] Synthead: I would like to leave config/ alone and have rails additionally read from another configuration directory on a docker volume for untracked, persistent storage
[22:12:37] Synthead: jhass: is there a way I can do this without modifying upstream code?
[22:14:31] Synthead: jhass: that's not a bad idea at all
[22:14:38] Synthead: jhass: thanks a lot!
[22:21:44] Synthead: jhass: is there a rails-like way to do that I'm trying to do (add a config dir) that would work natively with database.yml?

2016-07-14

[19:50:19] Synthead: Read error: Connection reset by peer
[19:54:21] Synthead: has joined #ruby
[19:54:21] Synthead: has joined #RubyOnRails

2016-07-06

[19:27:39] Synthead: is there a way to pass an explicit null value via URI params?
[20:15:44] Synthead: is there a way to check if there's a "not null" constraint in a model reflection?
[20:24:52] Synthead: fox_mulder_cp: something like ThatModel.reflections[that_reflection].not_null? (but working)
[20:27:22] Synthead: that's cause it's already been updated :)
[20:27:29] Synthead: hence after_update
[20:27:35] Synthead: you probably want a before_update or something
[20:29:02] Synthead: fox_mulder_cp: I'm not looking if one reflection on a model is nil, but if the reflection itself supports nil values
[20:29:23] Synthead: USvER: what are you trying to do?
[20:29:59] Synthead: why are you changing that model?
[20:30:04] Synthead: what's the end goal?
[20:30:09] Synthead: ACTION brb

2016-06-30

[23:28:53] Synthead: can I have an app/models/concerns/foo.rb and app/controllers/concners/foo.rb, or would one override another?

2016-06-29

[07:17:39] Synthead: Ping timeout: 276 seconds
[07:19:02] Synthead: has joined #RubyOnRails
[07:19:02] Synthead: has joined #ruby
[07:21:02] Synthead: Max SendQ exceeded
[07:21:32] Synthead: has joined #RubyOnRails
[07:21:32] Synthead: has joined #ruby

2016-06-24

[21:19:22] Synthead: in routes.rb, I have "resources :resources", and in resources_controller.rb, I have "def show; ...; end". I can pass, i.e., /resources/5 and hit the "show" route with params[:id] == 5. Is there a way I can get this url the other way around? Meaning, can I dynamically generate a URL of /resources/5 from a model class and ID?
[21:21:18] Synthead: <%= resources_path(5) %> returns "/resources.5". is this normal?
[21:22:10] Synthead: choke: why not do ...(@key => @params)? is the key not a string?
[21:23:38] Synthead: choke: it sounds like it shouldn't matter tbh
[21:24:32] Synthead: centrx: why does it join the URI with a "." ?
[21:25:45] Synthead: centrx: perfect! thanks a lot!

2016-06-23

[23:00:41] Synthead: Remote host closed the connection
[23:18:44] Synthead: has joined #ruby
[23:18:44] Synthead: has joined #RubyOnRails

2016-06-20

[18:35:12] Synthead: adam12: no, but I'm open to the idea
[18:35:30] Synthead: I need to write a string to a file, but I could do that with StringIO.new(string)
[18:36:01] Synthead: yeah why not... I'll try it
[18:37:00] Synthead: adam12: can it piggyback off of the Net::SSH connection?
[18:41:36] Synthead: lalalaaa: no, haha
[18:42:22] Synthead: omg, that's awesome
[18:42:35] Synthead: I'm at work but I'll watch the whole thing later XD
[18:43:28] Synthead: adam12: very interesting... I'll check it out!
[18:43:52] Synthead: adam12: I'm ok with a StringIO object
[18:44:08] Synthead: I think it's a lot less crufty than opening a file and doing a .puts anyway
[18:44:42] Synthead: I am responding to my own text
[18:44:50] Synthead: man, I am just on three wheels today
[18:47:55] Synthead: adam12: yeah that's actually nearly verbatim to what I'm doing, hah
[18:48:12] Synthead: adam12: the scp bit piggybacked with the ssh connection worked with StringIO :)
[18:48:20] Synthead: I'm gonna see if it crashes the channel still
[18:49:01] Synthead: some guy made net-ssh-simple, but I looked at it and the syntax wasn't as nice as I wanted
[18:55:35] Synthead: adam12: works beautifully! thanks for the help!
[19:00:03] Synthead: ruby-lang367: you probably want to use rest-client and nokogiri
[19:00:21] Synthead: ruby-lang367: also, the company list is paginated, so you'll want to account for that
[19:00:54] Synthead: ruby-lang367: in chrome/chromium, open the console, go to the network tab, refresh the page, then scroll the results to see what I mean
[19:01:12] Synthead: it'll make ajax calls as you scroll with uris of 2/, 3/, 4/, etc
[19:02:25] Synthead: also, I didn't look at the ajax data, but you might be able to just JSON.parse the payload from that instead of using nokogiri
[19:03:30] Synthead: nerium: key1["key2"][2] ?
[19:03:43] Synthead: nerium: ["key1"]["key2"][2], rather?
[19:04:05] Synthead: oh I see what you're doing, nevermind
[19:04:39] Synthead: nerium: what's the use case?
[19:05:14] Synthead: nerium: in a static or dynamic fashion?
[19:06:14] Synthead: nerium: as in, is the code always going to be (i.e.) "x.y.z", or are you going to be taking user input for this or something?
[19:07:25] Synthead: nerium: are you going to be using this query-esque language just for your own code, or is it going to be seen in the final product?
[19:08:21] Synthead: nerium: ah, ok
[19:08:59] Synthead: nerium: the reason why I'm asking these questions is because it sounds like a bit of code smell over here
[19:09:22] Synthead: it's custom, so others will not know how to look it up, use it, it would have to be maintained, there might be weird bugs, etc
[19:09:48] Synthead: and on the turn of things, it'll likely be slower than standard ruby, and provide limitations (what if the key must have a "." in it?)
[19:10:18] Synthead: I think you're better off using an Array of keys, then using a recursive function with .fetch to dig into the object a bit
[19:11:34] Synthead: or dig! I didn't know about that one!
[19:11:37] Synthead: that's a cool method!
[19:12:15] Synthead: 1% of my code got uglier today by learning dig :D