badeball

Activity Graph

Page 1 of 4 | Next »

2019-04-13

[16:49:44] badeball: *.net *.split

2019-03-07

[04:26:33] badeball: *.net *.split
[04:53:44] badeball: has joined #ruby

2019-02-26

[09:35:08] badeball: Ping timeout: 245 seconds
[12:30:50] badeball: has joined #ruby

2019-02-11

[23:46:46] badeball: *.net *.split

2019-01-09

[11:31:06] badeball: has joined #ruby
[11:38:08] badeball: Quit: WeeChat 1.6
[11:45:42] badeball: has joined #ruby

2018-08-01

[07:33:02] badeball: gosh, I dislike it when I search for a method and docs.ruby-lang.org comes before ruby-doc.org
[07:33:31] badeball: I can't be the only one who finds it a bit hard to read green text on a white background, can I?
[07:36:49] badeball: cli documentation you say? installed it, but I get $ ri Array.sort # => Nothing known about Array
[07:37:59] badeball: I'm running arch, so it's packaged, but it wouødn't surprise me if that was the case
[07:38:07] badeball: however, I don't think they do it accidentally
[07:39:26] badeball: ah, there's a separete package called ruby-docs
[07:40:45] badeball: this is pretty crazy stuff, ri
[07:43:32] badeball: I've only really been using irb
[07:43:37] badeball: in what other ways am I missing out?
[09:36:51] badeball: dionysus69: my guess would be that Kernel#format converts it to a float and you lose the resolution again. can you try the builtin BigDecminal#to_s with 'F', IE. BigDecimal.new('123').to_s('F')
[09:44:14] badeball: Bish: you have a binary format in psql, so if you can serialize / deserialize your preferred float type in you language then you're good to go
[09:46:10] badeball: of course not, but it means that you can store / retrieve without lsos
[09:48:41] badeball: unless you can represent integers of arbritary length, then a rational suffers from the same presicion problems
[09:50:02] badeball: a rational and a floating point are just two different ways of representing numbers, but constrained by the same reality
[09:53:35] badeball: rationals can help you avoid accumulating floating errors over multiple arithmic operations
[12:48:59] badeball: *.net *.split

2018-07-20

[00:07:27] badeball: *.net *.split
[00:15:29] badeball: has joined #RubyOnRails
[00:15:51] badeball: has joined #ruby

2018-07-18

[08:52:51] badeball: I want to upload some content using Shrine, which expects an IO-like object. however, I can't have the content in memory or disk, so I want to give it an IO-like object where reading blocks until I can provide it with more content. is that achievable?
[10:15:30] badeball: profetes: I think IO.pipe is what I am looking for, with one thread writing and one thread uploading

2018-07-17

[07:05:26] badeball: I have a lazy enumerator and want to partition it and do something / iterate over both partitions in a lazy way. is there a way to do this without invoking the base, lazy enumerator twice? (is my question at all making sense?)
[07:07:17] badeball: while retaining the lazy property all the way
[07:11:58] badeball: I have a vague idea that I can achieve this using fibers
[09:34:10] badeball: regarding lazy partition, I kind of got something working with http://ix.io/1hs5, however if one were to EG. accidentally not iterate over both partitions, nothing would happen and no warnings emitted
[14:35:17] badeball: apeiros: I meant ops as in «whops, I accidentally topic when I wanted /topic»

2018-05-29

[02:47:17] badeball: *.net *.split
[02:47:47] badeball: has joined #RubyOnRails
[02:48:09] badeball: has joined #ruby

2018-05-09

[08:11:54] badeball: has joined #RubyOnRails

2018-05-01

[15:30:13] badeball: Remote host closed the connection
[15:36:16] badeball: has joined #ruby

2018-04-25

[12:25:58] badeball: *.net *.split
[12:27:22] badeball: has joined #ruby
[12:27:33] badeball: has joined #RubyOnRails
[15:01:29] badeball: *.net *.split
[15:03:05] badeball: has joined #RubyOnRails
[15:03:15] badeball: has joined #ruby

2018-04-13

[14:30:40] badeball: has joined #RubyOnRails

2018-04-05

[08:11:46] badeball: Ping timeout: 264 seconds
[08:13:13] badeball: has joined #ruby

2018-03-16

[16:03:02] badeball: *.net *.split
[16:04:04] badeball: has joined #ruby

2018-03-08

[19:59:23] badeball: Remote host closed the connection
[21:50:57] badeball: has joined #ruby

2018-01-04

[01:12:22] badeball: Ping timeout: 268 seconds
[01:12:29] badeball: has joined #ruby

2017-12-07

[11:18:56] badeball: Ping timeout: 248 seconds
[11:19:02] badeball: has joined #ruby

2017-12-01

[02:28:49] badeball: has joined #ruby

2017-11-19

[13:53:46] badeball: Quit: leaving
[13:53:55] badeball: has joined #ruby
[13:54:10] badeball: has joined #RubyOnRails

2017-11-18

[17:28:25] badeball: has joined #ruby
[17:28:42] badeball: Client Quit
[17:31:29] badeball: has joined #ruby
[17:32:07] badeball: Client Quit
[17:32:43] badeball: has joined #ruby
[17:33:13] badeball: has joined #RubyOnRails

2017-11-14

[21:59:39] badeball: Ping timeout: 250 seconds

2017-11-09

[02:51:46] badeball: Ping timeout: 248 seconds
[02:53:23] badeball: has joined #ruby

2017-06-27

[09:29:27] badeball: has joined #ruby

2017-06-20

[00:15:35] badeball: Write error: Broken pipe

2017-05-30

[09:49:04] badeball: has joined #ruby

2017-04-13

[01:25:35] badeball: Ping timeout: 268 seconds
[01:27:31] badeball: has joined #ruby

2017-04-12

[23:42:08] badeball: Ping timeout: 240 seconds
[23:43:17] badeball: has joined #ruby

2017-03-22

[20:13:39] badeball: has joined #ruby
[20:13:39] badeball: has joined #RubyOnRails

2017-03-20

[20:29:15] badeball: *.net *.split

2016-07-07

[23:35:06] badeball: Ping timeout: 246 seconds
[23:42:03] badeball: has joined #ruby
[23:42:03] badeball: has joined #RubyOnRails

2016-06-15

[23:13:01] badeball: *.net *.split

2016-03-16

[22:15:34] badeball: Ping timeout: 277 seconds
[22:15:42] badeball: has joined #ruby
[22:15:42] badeball: has joined #RubyOnRails

2016-02-27

[21:37:45] badeball: Ping timeout: 268 seconds
[22:54:04] badeball: has joined #ruby
[22:54:04] badeball: has joined #RubyOnRails
[22:54:04] badeball: Ping timeout: 276 seconds

2016-02-05

[16:16:54] badeball: Ping timeout: 272 seconds
[16:17:34] badeball: has joined #ruby
[16:17:34] badeball: has joined #RubyOnRails

2016-01-31

[23:27:15] badeball: Ping timeout: 240 seconds
[23:28:05] badeball: has joined #ruby
[23:28:05] badeball: has joined #RubyOnRails

2016-01-20

[18:22:04] badeball: *.net *.split
[18:23:58] badeball: has joined #ruby
[18:23:58] badeball: has joined #RubyOnRails

2016-01-07

[19:38:36] badeball: *.net *.split

2015-12-21

[09:50:03] badeball: *.net *.split

2015-12-02

[15:36:08] badeball: *.net *.split
[16:28:43] badeball: has joined #RubyOnRails
[16:28:46] badeball: has joined #ruby
[16:52:39] badeball: Ping timeout: 245 seconds
[17:00:48] badeball: has joined #ruby
[17:00:48] badeball: has joined #RubyOnRails

2015-11-29

[22:19:08] badeball: *.net *.split
[22:58:50] badeball: has joined #ruby
[22:58:50] badeball: has joined #RubyOnRails

2015-11-26

[19:02:07] badeball: *.net *.split
[19:11:10] badeball: has joined #ruby
[19:11:14] badeball: has joined #RubyOnRails

2015-11-21

[02:19:04] badeball: Write error: Broken pipe

2015-11-13

[12:30:21] badeball: Quit: leaving
[12:30:34] badeball: has joined #ruby
[12:30:34] badeball: has joined #RubyOnRails
[12:45:31] badeball: Quit: leaving
[12:47:29] badeball: has joined #ruby
[12:47:29] badeball: has joined #RubyOnRails
[12:54:35] badeball: Quit: leaving
[12:54:43] badeball: has joined #ruby
[12:54:43] badeball: has joined #RubyOnRails
[13:00:32] badeball: Quit: leaving
[13:00:40] badeball: has joined #RubyOnRails
[13:00:41] badeball: has joined #ruby
[13:01:48] badeball: Client Quit
[13:01:56] badeball: has joined #ruby
[13:01:56] badeball: has joined #RubyOnRails

2015-11-05

[17:04:54] badeball: *.net *.split

2015-10-16

[00:16:35] badeball: has joined #RubyOnRails
[00:16:38] badeball: has joined #ruby

2015-10-10

[21:43:07] badeball: *.net *.split

2015-07-12

[23:28:03] badeball: Ping timeout: 252 seconds
[23:28:09] badeball: has joined #ruby
[23:28:09] badeball: has joined #RubyOnRails

2015-06-21

[00:55:15] badeball: Ping timeout: 943 seconds

2015-06-20

[20:48:28] badeball: *.net *.split
[20:53:48] badeball: has joined #ruby
[20:53:48] badeball: has joined #RubyOnRails

2015-06-08

[03:27:42] badeball: *.net *.split
[03:28:17] badeball: has joined #ruby
[03:28:17] badeball: has joined #RubyOnRails

2015-06-03

[12:25:50] badeball: has joined #ruby

2014-09-04

[14:31:18] badeball: does #as_json really not call #as_json on instances included with the :include option?

2014-08-24

[20:32:46] badeball: when using the :touch options of belongs_to, does the associated object get touched when a new object is created?
[20:33:33] badeball: or is it only when an object is updated?

2014-06-01

[20:09:11] badeball: I'm having an issue with STI, where classes have not yet been loaded during development mode and consequently receive RecordNotFound after rails reloads (due to some file having been edited). what's the best way to eagerly load the subclasses of an STI design?
[20:25:26] badeball: for reference, I solved the above-mentioned problem by eagerly loading the subclasses (invoke some method on them) within ActionDispatch::Callbacks.after do; .. end, as suggested in https://www.ruby-forum.com/topic/1642198#996863

2014-01-16

[13:29:37] badeball: yeah, like articles regarding perl/python/bash are all magnificent
[13:36:57] badeball: those languages clearly attracts better writers
[14:55:04] badeball: I've never really understod those something for something-things. if you take a bunch of people without programming experience and teach them a framework, they're not turned into developers

2014-01-15

[12:45:28] badeball: I imagine that bugs might get funny once you start injecting code into possibly arbritary states
[12:46:09] badeball: I'm all up for fun though
[12:48:15] badeball: mikecmpbll: stuff like that tends to get bad in combination with lazy team members. if you're alone, then sure, some extra complexity won't do any harm
[12:56:24] badeball: pipecloud: you love js? :O js is immensely poor
[12:57:13] badeball: pipecloud: well, lets agree to disagree on that
[14:17:00] badeball: developers in a hurry who think they actually save significant time by abbreviating things..
[14:45:27] badeball: krz: you need to configure the production-environment so that it has the variables without them being in the repository
[14:46:09] badeball: for instance, you could have the application read a production-like config-file if it exists
[14:46:57] badeball: with apache (and probably any server), you have the SetEnv directive
[14:48:57] badeball: krz: something like that
[14:52:05] badeball: where I work at, we usually move the example config.yml to config.example.yml and symlink it back to config.yml, with config.yml being in .gitignore
[15:02:56] badeball: krz: according to what I read, the database.yml is generated for you by configurations you supply to aws (much like how Heroku works). I read this here: http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-rails.html
[15:06:32] badeball: krz: https://github.com/joeyAghion/opsworks_custom_env
[15:06:50] badeball: krz: I found it through stackoverflow, http://stackoverflow.com/questions/19462827/set-environment-variables-with-aws-opsworks
[15:07:01] badeball: krz: by googling 'aws opswork rails config variables'
[15:13:51] badeball: it doesn't seem like much code is required, so you might as well read through it and implement a minimum for it to work and thus remove the dependencies
[15:15:41] badeball: I noticed that Figaro was mentioned there and in my experience, that can be replaced by a single line of code in the application initializer
[16:36:59] badeball: andywww: the query itself won't be too complex, but I'm unsure of how to do the sorting with AR. I believe you can do the following: Club.include(:tweets).order_by { |club| club.tweets.map(&:retweet_count).sum }
[16:37:46] badeball: bear in mind, I haven't used AR in a while and have no idea of it'll run
[16:55:39] badeball: drojas: #build?
[16:56:31] badeball: as in collection.build
[16:57:45] badeball: drojas: a hash containing the attributes
[16:58:16] badeball: if you already have the object, isn't it sufficient to just set the foreign key yourself?
[17:36:57] badeball: drojas: I believe you'll see the same behavior if you do collection.to_a.append, as #append is aliased to #<< in rails-4
[17:37:04] badeball: aww, he left
[17:53:13] badeball: greengriminal: always the first 3 or those specifically?
[17:55:17] badeball: uhm, I'm not sure if I find an answer in that. do you want to filter out the first 3 elements of an array or three specific array elements?
[17:55:51] badeball: that wasn't really a yes or no question
[17:57:11] badeball: roles.map(&:name) - ['admin', 'user', 'VIP'] => ['read', 'write']
[17:57:17] badeball: greengriminal: ^
[19:06:53] badeball: I would hardly call that 'normal'
[19:07:11] badeball: sounds like a really tedious workflow
[19:07:52] badeball: ddd: you can accomplish the same thing with a clever environment, assuming you're on a unix-like system
[19:08:51] badeball: rakm: no doubt it doesn't belong there
[19:11:34] badeball: I do NOT understand why you don't create your own wrapper script instead of doing that shit every time you commit. how do you commit early and often if it is such a hassle?
[19:12:08] badeball: rakm: no, to ddd and his 'normal' ways
[19:13:23] badeball: ddd: do you even care for a neat version history or do you just ues vcs purely for the purpose of sharing code? one should never do something 'at the end of the day'
[19:15:16] badeball: you're still describing a workflow that affects how you commit (you said "when you're done for the day") and what other people see
[19:16:06] badeball: the whole point is to not clutter the project with personal stuff, but you're workflow imposed by your personal needs does affect the project
[19:16:32] badeball: but you argue to commit gem-changes "at the end of the day"
[19:17:35] badeball: it might work for you, but it's still a horrible solution to a seemingly easy problem. a clever environment and a wrapper-script can solve it.
[19:19:11] badeball: if you use a wrapper-script to include hirb and enter the rails-console, you pretty much don't have to do anything of what you're describing
[19:21:31] badeball: honestly, the gemfile groups sounds terrible as well, as it clutters the project with personal develop stuff
[21:06:27] badeball: ddd: this hirb-thing made me curious, so I looked through some IRB documentation and I found that by adding the following file in your home folder, you'll have nice hirb-output in every rails console without having to resort to adding stuff to your repository: https://gist.github.com/badeball/8444673
[21:12:11] badeball: rakm: in case you're still looking for a solution to using hirb ^

2014-01-14

2014-01-06

[02:10:04] badeball: sinatra is not difficult though. you can easily get through most of it in a night and as previously stated, it doesn't hurt to know.

2013-07-27

[12:37:10] badeball: artmann: 5.times.map { |i| i.days.ago }.reverse

2013-07-13

[20:18:34] badeball: self-updating packages? gee, use a package manager
[20:33:33] badeball: _str: what does ruby -v say right before you install? if it is not 2.0.0, then your rvm is not doing its thing
[20:36:53] badeball: enthrops: you can try relying on referer, which some clients will set, but generally no
[20:37:55] badeball: then you're out of luck
[20:38:53] badeball: however, hidden fields isn't that big of a pain. if you have a global javascript file running on all pages, you can easily make for example jquery always send along an extra parameter.
[20:41:42] badeball: enthrops: https://gist.github.com/badeball/d22d50ef391e5ce9b46d
[20:42:30] badeball: enthrops: uhm, r
[22:45:45] badeball: xavier23: #attr_accessor
[22:46:47] badeball: xavier23: http://www.ruby-doc.org/core-2.0/Module.html#method-i-attr_accessor

2013-05-07

[04:06:31] badeball: I seem to remember that setting config.assets.debug = nil would get rid of annoying asset logging during development, but that does not seem to work in 3.2.13. what is the way to do this these days?
[04:09:37] badeball: Radar: I've read that. accepted answer seemed tedious and I was wondering if there was a better way.
[04:11:52] badeball: Radar: I'm not an idiot. I wouldn't have asked if I hadn't already tried myself. what you are quoting is untrue, at least in my case.
[04:14:30] badeball: liquid-silence: the question is still how to disable logging of assets during development.
[04:15:16] badeball: liquid-silence: correct.
[04:15:52] badeball: liquid-silence: again, I've looked at that.
[04:17:30] badeball: as I said earlier, the solutions seemed tedious compared to what's worked perfectly well before, leading me to believe that a gem and another dependency might not be the correct way.
[04:19:19] badeball: liquid-silence: yeah, I've tested it, but I don't just settle for the first solution that works :)
[04:21:12] badeball: Radar: I've previously set config.assets.logger = nil and I can recall it working previously.
[04:21:55] badeball: liquid-silence: I was just asking to see what the canonical way was. jeez.

2013-05-03

[16:03:49] badeball: zoned: check out this railscast: http://railscasts.com/episodes/210-customizing-devise
[16:04:06] badeball: (I found that by googling 'devise username instead of email')

2013-05-01

[14:37:07] badeball: yes, but why would you?
[14:38:01] badeball: foofoobar: form_for essentially just outputs html, which you don't need helper methods to do
[14:39:04] badeball: foofoobar: I'm not sure what you are trying to do right now
[14:41:15] badeball: foofoobar: if you want to seperate forms, then use form_for twice.
[14:41:23] badeball: s/to sep/two sep/
[14:42:05] badeball: foofoobar: I really don't see what the problem is. you can use #fields_for multiple times, each on different parts of a collection of objects.
[14:42:32] badeball: foofoobar: I just gave you an example depicting how you can give #fields_for a collection of elements
[14:44:22] badeball: foofoobar: then I urge you to look at the documentation for #fields_for, because what I showed you is the canonical approach here. http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-fields_for
[14:50:02] badeball: that'd be pretty sweet
[14:53:07] badeball: foofoobar: ehhh. #take returns another array and does not take a block argument. my bad. it is supposed to say 'take(3).each do |one_cv|'
[14:54:43] badeball: foofoobar: fantastic
[14:58:22] badeball: Titas9x: https://github.com/mperham/sidekiq/wiki/API#queue?
[14:59:56] badeball: Titas9x: was that really all you needed? that was like the 2nd search result on google
[15:01:10] badeball: GarethAdams: he asked half an hour ago :P
[15:03:19] badeball: Titas9x: I guess you could always do echo "Sidekiq::Queue.new(\"default\").clear | rails c
[15:03:41] badeball: ugh, mind the missing "