The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-12-04

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:14 jberger preaction I like it, but I agree with sri, that's a pretty high link density
00:14 preaction yeah yeah yeah, i'll turn it into examples presently. busy doing that to another blog post first (well, it used to be a talk i was going to do, but now it's a blog post)
00:14 jberger If those are better as links then maybe we should get screenshots of the pages, if only for visual breakup
00:17 preaction i mean, i can do it as examples with Mojolicious::Lite apps
00:17 preaction that's what i'm doing for this one at least
00:22 robinsmidsrod joined #mojo
00:48 Leffe joined #mojo
00:54 aborazmeh joined #mojo
02:33 gizmomathboy joined #mojo
03:06 cascardo joined #mojo
04:53 dallaylaen joined #mojo
05:08 inokenty-w joined #mojo
05:44 jberger https://twitter.com/joelaberger/status/937557980987437056
06:08 dim0 joined #mojo
07:01 ashimema joined #mojo
07:02 Vandal joined #mojo
07:18 dod joined #mojo
07:23 dod joined #mojo
07:27 geospeck joined #mojo
07:47 AndrewIsh joined #mojo
08:24 trone joined #mojo
08:33 trone joined #mojo
09:28 dim0 joined #mojo
09:28 dim00 joined #mojo
09:50 geospeck joined #mojo
10:02 bombuzal joined #mojo
10:58 sri jberger: it's funny how Lite.pm is basically a long list of things we tell perl beginners not to do :)
10:58 sri no strict, monkey_patch, goto...
11:00 sri (they are of course the right uses for those features, but it's still funny)
11:25 trone joined #mojo
11:29 itaipu joined #mojo
11:39 karjala_ joined #mojo
11:50 dallaylaen joined #mojo
11:55 Leffe joined #mojo
12:10 bombuzal_ joined #mojo
12:37 bombuzal joined #mojo
12:53 itaipu joined #mojo
13:03 geospeck joined #mojo
13:13 jberger Hahaha I hadn't thought of that
13:15 mohawk "do what i say, not what i do"
13:22 caeles joined #mojo
13:27 caeles_ joined #mojo
13:31 haarg the class of things that you really shouldn't do until you fully understand why you shouldn't do them
13:46 dim0 joined #mojo
13:49 dim000 joined #mojo
13:58 geospeck joined #mojo
14:08 ayokh joined #mojo
14:09 bwf joined #mojo
14:09 Leffe joined #mojo
14:14 gizmomathboy joined #mojo
14:19 dim0 joined #mojo
14:21 marty joined #mojo
14:21 marty joined #mojo
14:27 marcm joined #mojo
14:31 marty joined #mojo
14:32 marty joined #mojo
14:40 dim0 joined #mojo
14:41 inokenty-w joined #mojo
14:44 Pyritic joined #mojo
14:46 marty joined #mojo
14:59 tchaves joined #mojo
15:06 gryphon joined #mojo
15:10 Pyritic joined #mojo
15:28 karjala_ My new site presents the data I'm sending it through the forms, in garbled unicode
15:28 karjala_ I'm trying to figure out why
15:29 karjala_ First of all: I'm sending the data in multipart - does $self->param('something') not decode from UTF-8?
15:29 karjala_ if it's from multipart?
15:30 karjala_ It could be a database thing (first time using DBIx::Class)
15:31 jberger karjala_ what database are you using?
15:31 karjala_ mysql
15:31 jberger there are certain settings that you need to make mysql sane on utf8
15:32 karjala_ oh ok
15:32 jberger someone else can probably tell you better, but I'm sure they are written down someplace
15:32 karjala_ I'll test writing & reading to the db from a simple script
15:32 karjala_ that should show what the problem is
15:33 jberger karjala_ https://metacpan.org/pod/distribution/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#MySQL
15:33 karjala_ thanks!!! :-)
15:34 karjala_ excellent
15:36 karjala_ and yes, that solved the problem
15:37 jberger great! glad to hear it
15:38 jberger in other news, after titling my last post "Don't Fear the Full App" I can't stop humming/whistling/singing "Don't Fear the Reaper"
15:41 geospeck joined #mojo
15:42 geospeck joined #mojo
15:43 geospeck joined #mojo
15:43 geospeck joined #mojo
15:50 geospeck joined #mojo
15:57 mohawk jberger, needs moar cowbell
16:09 kaare joined #mojo
16:21 inokenty joined #mojo
16:23 geospeck joined #mojo
16:26 mib_w9riop joined #mojo
16:27 Grinnz the only way to make mysql sane on utf8 currently is to pin to version 4.042, because the sanity was reverted due to breaking changes
16:27 Grinnz er, DBD::mysql 4.042
16:42 lodin joined #mojo
16:49 ChmEarl joined #mojo
16:58 sh14 joined #mojo
17:14 itaipu joined #mojo
17:27 jamesaxl joined #mojo
17:36 dod joined #mojo
17:37 dod joined #mojo
17:44 * sri is starting to get hyped about the altered carbon netflix series
17:44 preaction innnnnteresting
17:44 sri first trailer is out
17:49 karjala_ joined #mojo
17:50 * genio goes to watch
17:52 genio ooooh. I hope that turns out to be as good as the trailer seems
17:55 Leffe joined #mojo
18:20 trone joined #mojo
18:30 bombuzal_ joined #mojo
18:59 Leffe joined #mojo
18:59 Seth joined #mojo
19:07 dim0 joined #mojo
19:32 mishanti1 How do you guys usually structure your apps with regards to which urls get exposed? Do you have it all in your `MyMagicApp.pm` or let controllers publish what they practically "own"?
19:32 mishanti1 In other words, do you use the main application to assemble, or as an authority?
19:33 preaction startup does all my routing for me, delecating to controller methods
19:33 preaction so, startup knows all the urls
19:35 Grinnz mojo is not really designed for controller-specific routing. but there are ways to do it
19:35 mishanti1 preaction: Seems like a common way of doing it, yeah.
19:35 Grinnz for small apps i just do routing directly in startup. for a large app I put routing in its own module, and call that from startup
19:36 mishanti1 Grinnz: The reason I was asking is I've heard from some that they delegate the routing setup. Once you hit a couple of hundred endoints the startup-sub tend to be ...interesting.
19:37 Grinnz that's a common practice in catalyst, which supports that style
19:37 Grinnz https://metacpan.org/pod/Mojolicious::Plugin::Mojolyst is a kinda hacky way to get that behavior in mojo
19:38 Leffe joined #mojo
19:38 preaction i often have a `$r->get( '/*template', { template => 'index' } )->to( cb => sub { shift->render } )` as well, just because
19:38 mishanti1 preaction: That's a neat one. :)
19:39 mishanti1 Being able to do that kind of stuff is awesome.
19:39 Grinnz the cb there isn't actually necessary fyi
19:39 preaction even better
19:40 jberger Grinnz: really?
19:40 jberger in the ->to() method
19:40 Grinnz i mean the whole ->to call there isn't necessary
19:41 jberger sure
19:41 Grinnz "the cb" meaning the callback, not the literal string cb
19:41 jberger oh, yes that's also true
19:42 jberger mishanti1 yes large ones could get interesting, but you can of course split the definitions into methods that get called
19:43 jberger or if it is a JSON api, use the OpenAPI plugin, etc
19:43 jberger in large applications, distributing the router might make the startup method look cleaner, but suddenly it is much harder to reason about the router
19:44 jberger when working on Meta::CPAN, a Catalyst app, I often have to think hard and check several places before I actually find where a route is coming from
19:44 jberger possible that I'm doing it wrong/badly as I'm not very familiar with Catalyst, but that's just the experience I have had
19:49 preaction agreed
19:51 mishanti1 Thank you for the input :)
19:55 rickbol joined #mojo
20:03 amphibulus joined #mojo
20:11 Grinnz in other words, maintainability tradeoffs all around
20:12 Leffe joined #mojo
20:13 preaction "explicit is better than implicit"
20:14 maschine I keep all my routes in startup.. haven't had any problems with it, and it's easy to follow.
20:15 maschine it's hard enough keeping track of a bunch of modules :p
20:17 Grinnz maschine: it gets a little distracting from the rest of startup when you have 300 lines of routes
20:20 maschine true, the most I've had is 70 - but there's nothing else much in my startup
20:21 maschine is there an easy way to get a count of routes?
20:22 Grinnz go to a non-existent page and count the rows in the development error page lol
20:22 Grinnz probably easier ways
20:22 preaction there's a route command no?
20:23 Grinnz something like that
20:23 purl something like that is totally possible
20:23 preaction routes
20:29 maschine neat - http://mojolicious.org/perldoc/Mojolicious/Command/routes
21:13 Leffe joined #mojo
21:16 Leffe joined #mojo
22:02 dexteruk joined #mojo
22:03 dexteruk using mojolicious useragent is there a quick way to just return a tag section
22:03 dexteruk i dont want the all the html i just need the <section ..... </section>
22:04 dexteruk i can do this with awk
22:04 jberger use the dom method
22:04 dexteruk but it a little to complicated if i can just get the section i want, i looked mojo::dom
22:04 dexteruk but i couldnt work out how to maintain the html structure
22:05 dexteruk it convers everything into an array
22:05 jberger ?
22:05 Grinnz read the docs, don't use the internal structure
22:05 Grinnz https://metacpan.org/pod/Mojo::DOM#at
22:06 Grinnz you can also pass a selector to ->dom itself to automatically call ->find with that selector https://metacpan.org/pod/Mojo::Message#dom
22:06 Grinnz ->at is like ->find but only returns the first thing that matches, instead of the collection of all matches
22:23 * sri still thinks we should have this in mojo https://metacpan.org/source/FERREIRA/Kevin-Command-kevin-0.4.0/lib/Kevin/Commands/Util.pm#L8
22:23 sri at least for command line apps
22:27 perlpilot except without the error I presume.  (look at the line for months)
22:28 sri yes, without the bug :)
22:28 inokenty left #mojo
22:30 sri little odd there have been no feature requests for the minion ui yet
22:30 sri would have expected at least a request for https://imgur.com/yKtOYgw
22:33 jamesaxl joined #mojo
22:45 Grinnz sri: i wrote a function like that once, based on moment.js fromNow()
22:45 gryphon joined #mojo
22:46 Grinnz https://gist.github.com/Grinnz/34a635c072ab913b33360cf65714eeac
22:55 Seth joined #mojo
23:04 gordonfish joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary