ramblinpeck

Activity Graph

Page 1 of 1

2016-07-10

[05:00:00] ramblinpeck: *.net *.split
[08:54:03] ramblinpeck: has joined #ruby

2016-06-21

[19:30:29] ramblinpeck: Ping timeout: 264 seconds
[19:32:58] ramblinpeck: has joined #ruby

2016-06-09

[05:23:23] ramblinpeck: Ping timeout: 250 seconds
[05:35:19] ramblinpeck: has joined #ruby
[06:08:08] ramblinpeck: Ping timeout: 272 seconds
[06:12:22] ramblinpeck: has joined #ruby

2016-05-24

[06:16:59] ramblinpeck: Ping timeout: 260 seconds
[06:21:30] ramblinpeck: has joined #ruby

2016-05-18

[08:45:41] ramblinpeck: Ping timeout: 250 seconds

2016-05-08

[01:44:13] ramblinpeck: Read error: Connection reset by peer
[01:46:01] ramblinpeck: has joined #ruby

2016-04-29

[14:33:11] ramblinpeck: *.net *.split
[14:43:35] ramblinpeck: has joined #ruby

2016-04-27

[06:59:16] ramblinpeck: Ping timeout: 264 seconds
[07:04:12] ramblinpeck: has joined #ruby

2016-04-15

[15:12:40] ramblinpeck: Ping timeout: 260 seconds
[15:39:13] ramblinpeck: has joined #ruby
[16:16:27] ramblinpeck: Ping timeout: 260 seconds
[16:18:49] ramblinpeck: has joined #ruby
[17:26:58] ramblinpeck: *.net *.split
[17:50:36] ramblinpeck: has joined #ruby
[19:22:51] ramblinpeck: Ping timeout: 276 seconds
[19:29:42] ramblinpeck: has joined #ruby

2016-04-13

[09:47:58] ramblinpeck: *.net *.split

2016-03-29

[17:07:29] ramblinpeck: Ping timeout: 268 seconds
[17:19:11] ramblinpeck: has joined #ruby

2016-03-12

[16:12:19] ramblinpeck: Ping timeout: 246 seconds

2016-03-02

[16:15:33] ramblinpeck: Ping timeout: 264 seconds
[16:21:46] ramblinpeck: has joined #ruby

2016-03-01

[19:25:45] ramblinpeck: *.net *.split
[19:31:34] ramblinpeck: has joined #ruby

2016-02-16

[23:38:42] ramblinpeck: *.net *.split

2016-01-30

[01:04:02] ramblinpeck: *.net *.split
[23:10:41] ramblinpeck: Ping timeout: 240 seconds

2016-01-26

[10:58:46] ramblinpeck: Ping timeout: 240 seconds
[11:01:38] ramblinpeck: has joined #ruby

2016-01-13

[18:10:24] ramblinpeck: has joined #ruby

2016-01-07

[19:38:34] ramblinpeck: *.net *.split

2016-01-02

[00:00:50] ramblinpeck: Ping timeout: 240 seconds
[00:10:56] ramblinpeck: has joined #ruby

2015-12-13

[10:26:16] ramblinpeck: Ping timeout: 240 seconds
[10:48:08] ramblinpeck: has joined #ruby
[18:13:56] ramblinpeck: Ping timeout: 240 seconds

2015-12-12

[17:42:15] ramblinpeck: *.net *.split

2015-12-02

[15:38:43] ramblinpeck: *.net *.split
[16:47:37] ramblinpeck: has joined #ruby
[19:59:15] ramblinpeck: Remote host closed the connection
[20:22:17] ramblinpeck: has joined #ruby

2015-11-26

[19:02:02] ramblinpeck: *.net *.split

2015-11-14

[10:20:39] ramblinpeck: Ping timeout: 252 seconds
[10:21:51] ramblinpeck: has joined #ruby

2015-11-08

[02:41:36] ramblinpeck: Remote host closed the connection
[12:56:05] ramblinpeck: has joined #ruby

2015-10-31

[16:40:47] ramblinpeck: Ping timeout: 240 seconds
[16:44:41] ramblinpeck: has joined #ruby

2015-10-16

[00:15:57] ramblinpeck: has joined #ruby

2015-10-06

[22:22:30] ramblinpeck: Remote host closed the connection
[23:37:16] ramblinpeck: has joined #ruby

2015-09-22

[09:58:51] ramblinpeck: has joined #ruby

2015-07-30

[15:29:25] ramblinpeck: Write error: Broken pipe
[16:28:10] ramblinpeck: has joined #ruby

2015-07-26

[01:44:26] ramblinpeck: has joined #ruby
[11:05:56] ramblinpeck: *.net *.split

2015-07-20

[07:31:52] ramblinpeck: Read error: Connection reset by peer
[07:53:10] ramblinpeck: has joined #ruby

2015-07-16

[03:45:18] ramblinpeck: Read error: Connection reset by peer
[04:16:12] ramblinpeck: has joined #ruby

2015-07-09

[22:24:39] ramblinpeck: hi all, stupid question, but is there an option in 2.1.2 to force to_yaml to indent lists? Have it outputting to a file that saltstack is consuming and it needs the indents to parse it
[22:28:02] ramblinpeck: zenspider: it is what it is and thats the requirement I'm dealing with
[22:28:17] ramblinpeck: how about we say I want yaml pretty-printed
[22:35:49] ramblinpeck: zenspider: no luck, calling YAML.dump explicitly has the indent option but that just affects the indentation it already shows. I guess no way to force indentation at each level :(
[22:36:55] ramblinpeck: zenspider: coming right up
[22:40:50] ramblinpeck: zenspider: https://gist.github.com/peck/570931f13e50672115e4
[22:45:48] ramblinpeck: zenspider: I believe its optional in the spec iirc, but not sure
[22:49:53] ramblinpeck: zenspider: oddly enough putting it in an array makes it work
[22:52:56] ramblinpeck: zenspider, actually nope it doesnt, that puts a leading '- ' in front of each hash key, bleh

2015-07-08

[22:55:11] ramblinpeck: Ping timeout: 248 seconds
[22:55:46] ramblinpeck: has joined #ruby

2015-07-01

[14:46:38] ramblinpeck: *.net *.split

2014-08-12

[18:20:11] ramblinpeck: hi all, is there a method like Enumberable#find that returns the value of a function called on the element and not the element? eg [group1, group2, group3, group4].find {|group| group.invitation_template} and have that return the template instead of having to call invitation_template again?
[18:20:30] ramblinpeck: little thing, but feels like there should be a way that I'm just not thinking of
[18:21:55] ramblinpeck: jhass: ah, I like that, a little terse but makes sense
[18:24:12] ramblinpeck: jhass: find seems to return an enumerable with that
[18:25:34] ramblinpeck: which is odd, I though find always returned the element
[18:26:54] ramblinpeck: yeah, ActiveSupport is
[18:27:06] ramblinpeck: ah, I see, I can jsut tack on find{|x| x} and it works
[18:27:59] ramblinpeck: interesting, I'd almost think that would be the default behavior, but I guess being able to pass around the enumerabble is useful sometimes
[18:32:00] ramblinpeck: oh well, its going to get a nice wrapper around it for my closure_tree object anyway, for find self or first ancestor with property
[18:33:07] ramblinpeck: and thinking about it, I'm basically building an OO inheritance model for instances...
[18:33:17] ramblinpeck: I wonder if thats a screw up im not seeing yet
[18:36:01] ramblinpeck: not sure how else it could be done though, basically groups are in a heirarchy. and if a leaf node doesn't have their own document template it asks its parent, and so on
[18:36:19] ramblinpeck: but yeah, the more I talk through it the more it seems something is a little off
[18:39:29] ramblinpeck: waxjar: in this case no, and groups can have subgroups and its a requirement that they use their nearest ancestor
[18:40:41] ramblinpeck: so either I take care of it with update logic all over the place to propogate changes down to leaves when a parent changes
[18:40:52] ramblinpeck: or have the logic look up
[18:41:29] ramblinpeck: yeah, heck with it, moving forward on this :)

2014-08-05

[02:42:19] ramblinpeck: evening all, does anyone have opinions on using liquid templates on top of draper? I need to produce some PDFs, and seems like the sensible way to do it, but "layering" a couple of view oriented things is starting to feel like a code smell

2014-08-04

[20:40:40] ramblinpeck: hi all, does anyone know of a good gem for working with WordprocessingML (docx) files? I'm looking for bring in a docx file to use as a template and replace some of the content programatically using something like liquid and output a new docx. Trying to figure out how deep into the WordprocessingML rabbit hole I'm going to have to go for this

2014-07-24

[01:26:05] ramblinpeck: does anyone have some good example code of devise + multiple user types. Seems quite a "conflict" between STI sucking later and devise multi-model sucking now
[01:27:54] ramblinpeck: bphogan: thats pretty much what I have now, but I'm finding them to be different enough, and having different associations that they really should be broken up
[01:29:19] ramblinpeck: yeah, I think thats what I'm going to look at doing, I'm looking over this railscast again from a while back http://railscasts.com/episodes/394-sti-and-polymorphic-associations?view=asciicast
[01:29:46] ramblinpeck: it's not perfect, and gets a little messy on the display side but getting draper in line I think its problably for the best
[01:30:13] ramblinpeck: I always feel like devise should be easier with multiple authable models, but just does not work very well
[01:32:01] ramblinpeck: bphogan: yeah, I've only done a few projects that really dealt with users, but I'm seeing the same thing
[01:32:10] ramblinpeck: and have read that advice a lot of places
[01:34:19] ramblinpeck: I guess I need to think of it as an authenticated user gets a profile (type) to play with
[01:34:42] ramblinpeck: and everything as far as app logic is about the profile and its interactions
[01:38:28] ramblinpeck: thats what the railcast I linked to does, eventually, the titles a bit misleading and talks about how its a bad approach
[01:38:40] ramblinpeck: I might as well use the oppertunity to bust out some service objects too
[01:39:45] ramblinpeck: yeah, this would all be refactor, along with the user types thing
[01:40:35] ramblinpeck: I have a pre-1.0 kind of thing going that works, but the current round of features is having me look ahead a bit and realize I'm in for "not fun" unless the user types get more distinct
[01:41:12] ramblinpeck: too much if elsif else logic creeping in to determine what actions they should have available
[01:41:39] ramblinpeck: and making views and reports kind of nasty
[01:41:48] ramblinpeck: anyway, off to hack away :)
[05:05:30] ramblinpeck: are there any good strategies for outputting multi-line html from a draper decordator and keep it readable in the draper code? examples are all h.conact and leads to less readable/nice looking code than the slim in views

2014-07-21

[20:50:23] ramblinpeck: related to that, is there a way to coerce a BigNum into being unsigned so that it plays nicely with Postgres BigInt? 64 bit number (hash) doesn't seem to fit and I think it has something to do with signedness
[20:52:06] ramblinpeck: hmm, zenspider: trying to insert 10656384688006670483 into a bigint column gives me: PG::NumericValueOutOfRange: ERROR: bigint out of range
[20:53:17] ramblinpeck: 10656384688006670483.bit_length is 64, so I'd think it would fit, but I think postgresql bigint is signed so its a 63 bit with the MSB used for signed-ness
[20:55:03] ramblinpeck: perhaps I'm going down the wrong trail here though, larger problem I'm trying to solve is storing a 64-bit hash into postgresql and using that for quick xor to find nearest neighbors
[20:55:26] ramblinpeck: so I'm not bound to bigint there, I could proobably do a bitfield of some sort, but just figured I'd go simplest first if I could
[20:56:14] ramblinpeck: yeah, PG doesn't have an unsigned bigint
[20:56:26] ramblinpeck: have to go to numeric after that which doesn't have an xor function
[20:56:38] ramblinpeck: so goes to the more low level types
[20:59:04] ramblinpeck: alright, well at least some validation that I wasn't missing something obvious
[21:02:10] ramblinpeck: right, any pointers on how to do that part?
[21:02:47] ramblinpeck: I guess bignum -> binary representation -> 2's bignum
[21:20:11] ramblinpeck: zenspider: thanks, I'll look at that

2014-07-16

[20:20:42] ramblinpeck: hi all, is there something special to enable the html5 required field attribute for simpleform? I have b.use :html5 in my config file but doesn't seem to be showing up in the output as required
[20:22:36] ramblinpeck: j_mcnally: right, on the backend, but simple_form doesn't read those validations for generating the form display, right?
[20:23:49] ramblinpeck: ah, re-reading that I think I get it
[20:24:11] ramblinpeck: I was reading that a not needing to add the "required: true" bit to the end of the f.input
[20:25:36] ramblinpeck: hmm, not seeing that with what I currently have, but I'm using a nested fields (location data for a user) so maybe thats why those bits aren't showing up
[20:25:59] ramblinpeck: location requires state_id and some other things, but doesn't stop form from being submitted if they're null
[20:26:48] ramblinpeck: aZtec: so I guess that means simple_form is very tied to activerecord and couldn't toss onto PORO to write out to AR objects later?
[20:28:17] ramblinpeck: not sure, validate_associated seems to be helping that. I should have added that before
[20:44:22] ramblinpeck: still not seeing the right thing with required being put on the html side, https://gist.github.com/peck/072fe6042377bc40edb0
[20:45:12] ramblinpeck: its adding the required class, but not the required input attribute, thinking I have to have a config setting wrong somewhere or I'm completely misinterpretting what I think it should be doing
[20:51:18] ramblinpeck: __joshua__: I like pundit for the task
[20:56:09] ramblinpeck: __joshua__: that would be all about building the scope appropriately for them
[20:56:36] ramblinpeck: or in the show? method directly
[20:57:00] ramblinpeck: your show? update? etc methods in your policy are just things that resolve to true/false
[20:58:46] ramblinpeck: simple bit from one of my apps, https://gist.github.com/peck/9e5063a9116518f1193f
[21:08:32] ramblinpeck: ok, figured out my problem with simple_form, the default initializer created by rails generate simple_form:install does not add the aria-required attribute, but delete the default config and it does
[21:08:46] ramblinpeck: thats kind of broken I think...

2014-07-08

[02:18:56] ramblinpeck: Is there a way to increment a range eg: (1..5) -> (2..6) without converting at an array, mapping +, and creating a new ones from the minmax?
[02:28:42] ramblinpeck: OffTheRails: that is a little cleaner, thanks. need a sliding window kind of behavior and nothing I can find says specifically that ranges are immutable it seems like they pretty much are

2014-06-25

[21:12:42] ramblinpeck: any pointers on adding a check/uncheck all to simple_form checkbox collection?
[21:13:35] ramblinpeck: would like to just add "check/uncheck" to the label if the collection is over a given size, and let jquery handle the rest, but cannot seem to figure out a way to do any calculating for the label generation

2014-06-19

[21:11:43] ramblinpeck: that be wrapped by ActiveModel or something?
[21:11:43] ramblinpeck: hi all, is there a best approach to create a non-table based model whose instances come from a sql query? playing with postgresqls range types and building a little reservation system to get familiar with it. I have a query that is designed to get all the unreserved time for a user, ActiveRecord::Base.execute returns correctly, but its all as strings, can

2014-06-10

[02:16:13] ramblinpeck: hi all, metaprogramming question, how can I pass variables into "class << self" style metaprogramming, as seen here https://github.com/geekq/workflow/blob/master/test/multiple_workflows_test.rb
[02:19:00] ramblinpeck: benzrf: not sure I'm understanding exactly where to put that?
[02:19:53] ramblinpeck: for the example I posted with the workflow gem, I want to conditionally add another state to the booking if it requires a review
[02:21:51] ramblinpeck: Eg, Booking#review_required? then define additional states
[02:24:46] ramblinpeck: let me put together a simplier example for my problem and see if I can figure it out or ask a better question :)
[02:34:11] ramblinpeck: benzrf: so I'm confused,I'm breaking inside the "class << self" of my Order instance, and seems the only thing in scope is the Order Class
[02:34:40] ramblinpeck: I seem to be missing whatever the piece is that allows me to access methods on my Order instance that called it
[02:35:01] ramblinpeck: or how to pass variables in, since self now refers to the Class and not the instance
[02:35:54] ramblinpeck: ok, no problem
[02:36:23] ramblinpeck: ari-_-e: coming up
[02:41:28] ramblinpeck: ari-_-e: https://gist.github.com/peck/c80c781fbdf3f64034c6
[02:42:20] ramblinpeck: CommercialOrder inherits from Object, and the initialize_workflow dynamically defines states in the workflow state machine depending on whether its reviewable or not
[02:46:44] ramblinpeck: ari-_-e: define the workflow, I realize its a bit convoluted, all the state machine gems I've found seem to dislike conditional states
[02:47:08] ramblinpeck: and I'm attempting to avoid the problem of defining different classes for each workflow, which branches out rather quickly
[02:47:33] ramblinpeck: so attempting to define workflow on the instances, from this example: https://github.com/geekq/workflow/blob/master/test/multiple_workflows_test.rb
[02:48:23] ramblinpeck: but the workflows are defined by the Class, so a bit confused about where I can pass parameters in, or get access to instance methods on the caller
[04:55:47] ramblinpeck: followup/somewhat related from my earlier question, is there a state machine gem that allows for conditional transitions? All seem to ignore a need for that
[05:18:54] ramblinpeck: RubyPanther: thanks, will watch now

2014-06-04

[05:20:57] ramblinpeck: hi all, is there something similiar to a pre-processor for ruby for abstracting out class definitions? I'm wanting to do something like this for building up more complex state machines without repeating myself a ton, but not sure its possible. https://gist.github.com/peck/2be39004960aa2531b82
[05:41:09] ramblinpeck: ari-_-e: that's right, essentially just want to be able to dump the state definitions into a class/module/mixin/anything, and be able to conditionally add it to the class
[05:42:14] ramblinpeck: its a bit convoluted, but the only way I can figure out how to do any dynamic state machine with the workflow gem without having a new class for each conditionals
[05:42:51] ramblinpeck: Yeah, the meta class thing I didn't know about, pasted over from example and didn't remove it
[05:46:02] ramblinpeck: ari-_-e: near the bottom, individual workflows for objects, https://github.com/geekq/workflow/blob/master/test/multiple_workflows_test.rb
[05:47:43] ramblinpeck: Ideally I'd like to be able to nest state machines and delegate to each when needed, but none of the state machine gems seem to support that
[05:48:03] ramblinpeck: and lacking time to write my own for this project seems like the closest I can get
[05:48:43] ramblinpeck: and this works, but trying to get it a little more DRY, and manageable for when I come back to it, add additional conditionals for new states, etc
[05:55:06] ramblinpeck: State definitions are what I want to factor out
[05:55:26] ramblinpeck: being part of the workflow DSL I'm not sure how to do that though
[05:56:24] ramblinpeck: as the workflows aren't composable as instances, so hoping to be able to do it as part of the definition
[05:57:06] ramblinpeck: hmm, that might work, I was thinking in terms of modules but proc just might be the ticket
[05:58:42] ramblinpeck: so the proc wouldn't have to have the method definted and know about #state, correct?
[06:00:57] ramblinpeck: Then do something like instance_eval &workflow1_proc to grab those states and put them in the new workflow definition?
[06:06:37] ramblinpeck: right, but to turn the proc into a proc that the specification will load it has to be evaled it seems
[06:06:49] ramblinpeck: ...that was a convoluted sentence :)
[06:09:26] ramblinpeck: ah, cool, thanks
[06:09:31] ramblinpeck: it looks like this is working