bougyman

Activity Graph

Page 1 of 10 | Next »

2019-01-15

[04:13:37] bougyman: and 418 is "I'm a teapot"
[04:13:54] bougyman: lemur: I have :)

2019-01-11

[22:02:27] bougyman: ddffg: I'd use a work queue for that.
[22:02:39] bougyman: so all rails does is put them on that work queue (beanstalk is nice for this)
[22:02:47] bougyman: then as many workers you want can work that queue to send the mail

2018-12-28

[14:39:37] bougyman: i was about to mention each_with_object
[14:39:38] bougyman: [1,2,3].each_with_object([]) { |n, sum| sum.push(n) if n.odd? }
[14:40:03] bougyman: but yeah, select is better
[14:41:30] bougyman: haha, it's true.
[14:43:37] bougyman: just cause it can doesn't mean it should, though
[14:43:38] bougyman: [1,2,3].inject(0) { |sum, n| n.odd? ? sum += n : sum }

2018-12-24

[14:40:56] bougyman: That's not an interesting problem.
[14:46:20] bougyman: are you looking for all files?
[14:47:34] bougyman: Nobun: Dir.glob('**/*').select { |f| File.file? f }
[14:47:36] bougyman: try that instead.
[14:47:40] bougyman: see if it's what you want.
[14:48:27] bougyman: and then just use the select block for your comparison.
[14:48:45] bougyman: f =~ /#{xext_in}$/ instead of File.file? f
[14:49:37] bougyman: Or even just Dir.glob("**/*.#{xext_in}") probably

2018-12-19

2018-12-18

[06:20:13] bougyman: Just gotta choose plugins that fit you.
[06:20:23] bougyman: Personally I like ctrlspace.

2018-12-11

[16:00:58] bougyman: if it's bound to 0.0.0.0 it would be serving all ips.
[16:01:11] bougyman: You don't have a reverse proxy in front of it?

2018-11-28

[11:41:10] bougyman: I use a module instance variable for it.
[11:42:26] bougyman: module MyApp; def self.log; @log ||= default_log; end; def self.log=(other); @log = other; end; end
[11:42:31] bougyman: but it doesn't complain if you change it
[11:43:23] bougyman: yeah, that's the most common pattern I see
[11:44:47] bougyman: module method
[11:45:37] bougyman: it's considered good style to use .
[11:45:47] bougyman: and weird to use :: for anything other than nesting namespaces.
[11:45:52] bougyman: or accessing ... yeah
[11:46:09] bougyman: :: _works_, but it's ruby idiom to use . for calling methods, not ::

2018-11-19

[17:22:13] bougyman: AR is an orm
[17:22:17] bougyman: arel is the dsl for sql, no?

2018-11-09

[15:59:50] bougyman: Tohm3: sounds like you jumped to chapter 14 without going through chapter 1
[15:59:51] bougyman: nor any of the ones between 1 and 14

2018-10-25

[22:11:26] bougyman: https://www.serverless-ruby.org/
[22:11:29] bougyman: have you signed it yet?

2018-10-23

[17:08:20] bougyman: what's the version number?
[17:08:25] bougyman: I mean, what's an example?

2018-09-04

[21:36:04] bougyman: leitz: make a ~/.inputrc and set the vi editing mode in that.
[21:36:13] bougyman: which will work for any readline based applications
[21:53:37] bougyman: works here.
[21:53:41] bougyman: is your ruby built without readline?

2018-08-30

[03:25:48] bougyman: there has to be a better way to do this.
[03:26:06] bougyman: without #inject-ing a hash to store the path iterator
[03:26:09] bougyman: [25] pry(main)> path.to_s.split('/').inject({files: [], path: []}) { |a, e| defa = Pathname.new(a[:path].join('/')).join("#{e}/default"); (a[:files] << defa) if defa.exist? ; a[:path] << e; a }[:files]
[03:26:09] bougyman: => #<Pathname:foo/bar/baz>
[03:26:09] bougyman: [24] pry(main)> path
[03:26:20] bougyman: => [#<Pathname:foo/default>, #<Pathname:foo/bar/default>, #<Pathname:foo/bar/baz/default>]
[03:26:24] bougyman: works, but I hate it.
[03:32:34] bougyman: path.descend.map { |e| d = e.join('default'); d.exist? ? d : nil }.compact
[03:32:36] bougyman: much better
[04:43:28] bougyman: Radar: thanks, got to that.
[04:43:35] bougyman: I knew inject was just all wrong
[04:47:19] bougyman: no it doesn't
[04:47:34] bougyman: need to .reverse, then
[04:57:22] bougyman: no, it's right
[04:57:24] bougyman: I want descend

2018-08-22

[13:57:08] bougyman: Ping timeout: 255 seconds
[13:59:37] bougyman: has joined #ruby

2018-08-16

[16:05:05] bougyman: benzrf: example?

2018-07-27

[14:39:38] bougyman: I don't understand the question.
[14:39:53] bougyman: you have a string "foo" as a variable?
[14:40:11] bougyman: If so, you could do { foovar.to_sym => 'bar' }

2018-07-20

[00:07:16] bougyman: *.net *.split
[00:15:33] bougyman: has joined #ruby

2018-07-19

[05:31:10] bougyman: Ping timeout: 276 seconds
[05:35:36] bougyman: has joined #ruby

2018-07-18

[05:16:31] bougyman: *.net *.split
[05:35:19] bougyman: has joined #ruby

2018-07-12

[00:34:20] bougyman: same ruby version?

2018-07-06

2018-06-25

[21:20:15] bougyman: dminuoso: nil

2018-06-01

[03:44:47] bougyman: *.net *.split
[07:47:37] bougyman: has joined #ruby

2018-05-29

[02:47:15] bougyman: *.net *.split
[02:48:08] bougyman: has joined #ruby

2018-05-07

2018-05-04

[05:15:43] bougyman: *.net *.split
[05:15:55] bougyman: has joined #ruby

2018-04-25

[12:25:54] bougyman: *.net *.split
[12:27:26] bougyman: has joined #ruby
[15:01:25] bougyman: *.net *.split
[15:03:10] bougyman: has joined #ruby

2018-03-05

[16:01:14] bougyman: modules are used for that.
[16:01:31] bougyman: well, closest thing to prototyping a method that ruby has.

2018-02-27

[02:48:41] bougyman: Ping timeout: 256 seconds
[02:55:51] bougyman: has joined #ruby

2018-02-20

[19:17:50] bougyman: I get it. That's why I don't use it.

2018-02-16

[18:56:51] bougyman: that's really a matter of opinion.
[18:56:58] bougyman: I would recommend: none.
[18:57:16] bougyman: #anythingbutrails is my hashtag
[18:58:19] bougyman: simple solutions for simple problems.
[18:58:25] bougyman: Not everything has to be a kitchen sink
[19:12:08] bougyman: type1team: if you're looking for an easy way to accomplish SEO, you're searching for a unicorn.

2018-01-18

[01:55:16] bougyman: *.net *.split
[01:55:30] bougyman: has joined #ruby

2017-12-23

[16:16:33] bougyman: Ping timeout: 248 seconds
[16:19:50] bougyman: has joined #ruby

2017-12-22

[23:06:58] bougyman: Ping timeout: 264 seconds
[23:46:39] bougyman: has joined #ruby

2017-12-07

[14:48:18] bougyman: *.net *.split
[14:54:22] bougyman: has joined #ruby
[21:43:05] bougyman: *.net *.split
[21:48:19] bougyman: has joined #ruby
[22:37:00] bougyman: *.net *.split
[22:42:09] bougyman: has joined #ruby

2017-11-30

[14:58:30] bougyman: I prefer Pathname for these things, Bish
[14:58:35] bougyman: >> Pathname('/sys/class/net').children.detect { |w| w.children.map(&:basename).map(&:to_s).include? 'wireless' }
[14:58:38] bougyman: => #<Pathname:/sys/class/net/wlo1>

2017-11-22

[01:04:05] bougyman: the Hash.new(0) is used all over our code when the hash is comprised of counters.
[01:13:16] bougyman: RickHull: how could you get burned by it for counters?
[01:14:03] bougyman: ah, understood.
[01:14:06] bougyman: Yes, only ints.
[01:14:14] bougyman: But for ints I do think it fits the use case perfectly.

2017-11-17

[17:42:14] bougyman: % perl -e 'print -1>>8;'
[17:42:15] bougyman: 72057594037927935%
[17:42:20] bougyman: ruby -e 'puts -1>>8'

2017-11-15

[01:49:20] bougyman: and then some don't.
[01:49:24] bougyman: like Sequel.

2017-11-13

[23:10:06] bougyman: RickHull: rubocop hates that.

2017-11-11

[02:14:45] bougyman: @foo = bar is pretty obvious
[02:14:51] bougyman: even if you aren't familiar with ruby

2017-11-02

[19:40:25] bougyman: validations of what?
[19:41:24] bougyman: There are a few ways i've seen.
[19:41:35] bougyman: Contracts, Design By Contract, is one I liked.
[19:41:55] bougyman: But validating input still happens before being handed off to the contracted method.

2017-10-16

[13:37:42] bougyman: { } that much faster

2017-10-07

2017-09-24

[04:44:33] bougyman: these are complex questions which require a lot more information about your architecture and app.
[04:45:01] bougyman: perhaps better asked in #rubyonrails, too

2017-09-21

[23:40:06] bougyman: backticks shell out
[23:40:30] bougyman: %x{ls} and `ls` essentially are the same.
[23:41:26] bougyman: part of the language

2017-09-16

[15:12:12] bougyman: anyone know why curl would work on a box but ruby (rest-client) gives SSL Verify Fail?
[15:12:24] bougyman: I didn't think I had to recompile ruby to get new certs.
[16:31:19] bougyman: RedNifre: I had to rebuild ruby
[16:31:20] bougyman: doesn't make a lot of sense, but whatev
[16:38:49] bougyman: that's my thought.
[16:38:58] bougyman: but I figured I would get an error other than invalid cert, for that.
[16:39:00] bougyman: no worries.
[16:39:03] bougyman: fixed is fixed.

2017-09-01

[20:15:08] bougyman: Ping timeout: 240 seconds
[20:16:04] bougyman: has joined #ruby

2017-08-25

[14:42:17] bougyman: which bundle
[14:42:20] bougyman: and which ruby
[14:42:26] bougyman: i mean: type those
[14:42:29] bougyman: `whicn bundle`
[14:42:38] bougyman: and `which ruby`
[14:44:24] bougyman: GreatPotato: it is.
[14:44:40] bougyman: gem i bundler
[14:44:51] bougyman: it will put a bundler in your rvm path which supercedes /usr/bin/bundle

2017-08-24

[15:31:16] bougyman: not necessarily, FrostCandy
[15:31:21] bougyman: what does the tree look like?
[15:31:25] bougyman: what kind of program is it?
[15:31:41] bougyman: rails or other?
[15:32:01] bougyman: routes.rb is where i'd look to see what methods are exposed to the public.
[15:32:12] bougyman: though that can be abstracted so much as to not be helpful sometimes.
[15:32:20] bougyman: app/models should contain the business logic.
[15:33:00] bougyman: and app/controllers are where routes are dispatched to. methods in the controllers/ classes are, that is.

2017-08-16

[01:34:40] bougyman: Quit: ZNC 1.6.4 - http://znc.in
[01:34:54] bougyman: has joined #ruby
[05:13:54] bougyman: this is really not a job for regex.
[05:14:07] bougyman: you can do some crazy backtracking.
[05:14:11] bougyman: warrshrike: a parser.
[05:14:55] bougyman: warrshrike: you can just hack around that.
[05:15:04] bougyman: count the brackets in the string before you do your thing.
[05:15:18] bougyman: use the regex if the thing doesn't hit your edge cases.
[05:15:22] bougyman: if it does, do something else.
[05:17:32] bougyman: whatever it takes.
[05:17:37] bougyman: some recursion could pull it off.
[05:19:32] bougyman: I meant a recursive method, not regex recursion.
[05:19:47] bougyman: I mean, that method would likely use some regex or other string matching shit.
[05:20:06] bougyman: I'm trying not to program this for you and just get you thinking.
[05:20:46] bougyman: not as helpful as you figuring it out yourself.
[05:20:51] bougyman: that's how you become guru.
[05:21:32] bougyman: there's no anchor you could use?
[05:21:41] bougyman: That's kinda the rule with when you use regex or not.
[05:21:52] bougyman: If you can't anchor it, probably not the right tool.
[05:22:01] bougyman: ^ and $ are anchors, but there are many others.
[05:22:09] bougyman: \b, for instance
[05:22:14] bougyman: but that's not applicable here.
[05:22:26] bougyman: if the last ] were always followed by a \n, you could use $
[05:23:27] bougyman: don't [ inside the ^[ ]$ fuck you up just as much?
[05:24:03] bougyman: I guess only if they come after a ] in it.
[05:24:08] bougyman: still, it's a mess.
[05:24:21] bougyman: you can't contain on [ and ] if [ stuff ] stuff can contain [ and ]
[05:25:19] bougyman: wait, there's always quotes in the thing?
[05:25:22] bougyman: If so, that's your anchor.
[05:25:48] bougyman: [" starts it, and "] ends it.
[05:25:55] bougyman: well you put quotes there :)
[05:27:18] bougyman: the comma could be used, I think that's why 08/15-22:03 <....... elomatreb> warrsrike: Can commas appear in the brackets/fields?
[05:27:21] bougyman: he asked that.
[05:27:31] bougyman: if there can be commas in there, too, that fucks you up, a bit
[05:27:39] bougyman: cause you can't guarantee ], won't be in the input
[05:27:51] bougyman: 1st rule of regex: Know your data.

2017-08-15

[02:31:09] bougyman: rvm doesn't work under #/bin/sh
[02:31:15] bougyman: took me like 10 minutes to figure that out.

2017-08-14

[23:51:32] bougyman: *.net *.split
[23:52:23] bougyman: has joined #ruby

2017-08-04

[03:22:20] bougyman: what are TRUE and FALSE?
[03:22:21] bougyman: those are constants.
[03:22:22] bougyman: [3] pry(main)> a = true && a = false
[03:22:39] bougyman: [6] pry(main)> a = TRUE && a = FALSE
[03:23:02] bougyman: dunno what ruby version is giving you that.
[03:23:09] bougyman: I didn't, either.
[03:23:12] bougyman: never seen that.
[03:23:17] bougyman: I've seen TrueClass and FalseClass
[03:23:22] bougyman: but not TRUE and FALSE
[03:24:19] bougyman: [7] pry(main)> RUBY_VERSION
[03:24:22] bougyman: => "2.2.3" here

2017-08-02

[04:24:40] bougyman: there's not a full concurrency js implementation that I know of.
[04:24:45] bougyman: it's all an event loop, in node.
[04:25:38] bougyman: use jruby or rubinius

2017-07-14

[17:16:29] bougyman: that's a specific cop
[17:16:55] bougyman: cwood: you're not using either x or y somewhere after that.

2017-07-13

[05:54:53] bougyman: those regex should bever be used.

2017-07-06

[21:17:57] bougyman: ok, so /msg manveru yeah, work got that busy.

2017-07-04

[22:10:22] bougyman: the block is the function.
[22:11:46] bougyman: that should need a monad, shouldn't it?
[22:11:49] bougyman: It's side effect.