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

IRC log for #mojo, 2016-09-22

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

All times shown according to UTC.

Time Nick Message
00:35 genio https://www.whoismrrobot.com/
00:35 genio sri: ^ :)
00:43 damaya joined #mojo
00:43 damaya did res->content->move_to become deprecated?
00:43 damaya $ua->get($url)->res->content->move_to doesn't seem to work anymore
00:44 genio joined #mojo
00:44 damaya Ahh, works, my bad :D
00:49 Grinnz genio: this is some assassin's creed/abstergo industries stuff :)
00:51 Grinnz some of the assassin's creed games are presented as a game within the game, created by "abstergo" which is sort of a fictional foil for ubisoft, owned by the templars, with a bunch of templar propaganda, but then the games get "hacked" by the assassins showing the true story
00:51 Grinnz but they had lots of this sort of video content
01:34 damaya joined #mojo
01:45 ivi joined #mojo
02:05 aaa2016 joined #mojo
02:14 noganex joined #mojo
02:16 Adurah joined #mojo
02:35 Adura_ joined #mojo
02:37 Adura joined #mojo
03:21 damaya joined #mojo
03:55 Grinnz walking dead season 6 and gotham season 2 on netflix :o guess i will have less time for overwatch
04:03 jberger heh, according to chromatic (I'm assuming that's the author here) we already support HTTP/2 \o/ http://modernperlbooks.com/whitepapers/developers/web-application-development.html
04:04 Grinnz oops
04:04 Grinnz well it says "goes to great lengths to support", not that it's necessarily supported :P
04:04 jberger true
04:05 Grinnz but yeah that is a strong implication
04:05 jberger we certainly are closer than anyone else
04:08 Adurah joined #mojo
04:15 polettix joined #mojo
05:14 tyldis joined #mojo
05:36 dod joined #mojo
05:41 dod joined #mojo
05:46 jamesaxl joined #mojo
06:32 Vandal joined #mojo
06:37 mbudde joined #mojo
06:40 AndrewIsh joined #mojo
06:43 dod joined #mojo
07:01 polettix joined #mojo
07:42 osfabibisi joined #mojo
07:50 polettix joined #mojo
08:01 tyldis Slightly off topic: any recommendations for rather simple css/js frameworks? Writing APIs and using Mojo, but would like to bundle small, simple, but nice-looking frontends to them.
08:02 tyldis Googling that topic is just futile as there seems to be more of these frameworks than websites these days.
08:08 nicomen jberger: noe sure which disagreeing I was doing. My comment yesterday was not at all meant as a disagreement of anything
08:12 juikuen joined #mojo
08:13 osfabibisi tyldis: use sass/scss.  I'm not sure you need more for css than that, but then I'm not a designer
08:14 osfabibisi js: jquery or one of the smaller versions (zepto maybe?)  I also like the look of Cycle.js, it's a reactive thingy, but really small, and has some awesome video tutorials explaining how to derive it.  (Well worth watching even if you don't end up using the framework I think)
08:20 marcus sri: Are you on linux now?
08:35 ashimema_ joined #mojo
08:45 polettix joined #mojo
08:59 mbudde joined #mojo
08:59 trone joined #mojo
09:00 rubin joined #mojo
09:03 tyldis osfabibisi: Thanks, I'll have a look :)
09:24 cpan_mojo Mojolicious-Plugin-UniqueTagHelpers-0.03 by RSHADOW https://metacpan.org/release/RSHADOW/Mojolicious-Plugin-UniqueTagHelpers-0.03
09:30 Adura joined #mojo
09:32 Lee that dist seems to be lacking a file or two...
09:54 newbie joined #mojo
10:16 kaare joined #mojo
10:42 aaa2016 joined #mojo
10:57 tchaves joined #mojo
11:07 cpan_mojo Mojolicious-Plugin-UniqueTagHelpers-0.04 by RSHADOW https://metacpan.org/release/RSHADOW/Mojolicious-Plugin-UniqueTagHelpers-0.04
11:12 pink_mist Lee: 0.01 and 0.02 were exactly the same, but now with 0.04 he seems to have finally got things included
11:13 rubin hi
11:13 Lee hurrah!
11:13 rubin yes I miss MANIFEST
11:14 pink_mist rubin: ah, it's your release? good going on finally getting it right :P
11:16 rubin pink_mist: yes. I think to need relogin as "rshadow"
11:18 rubin joined #mojo
11:21 rshadow joined #mojo
11:26 aaa2016 joined #mojo
11:30 aaa2016 joined #mojo
11:41 jberger tyldis: i have been using vuejs for data binding and usually bootstrap for layout/style (sometimes semantic ui)
11:42 polettix joined #mojo
12:09 anton joined #mojo
12:22 blonewolfs joined #mojo
12:30 tyldis jberger: Thanks for the input :)
12:49 itaipu joined #mojo
12:53 zivester joined #mojo
13:05 rshadow joined #mojo
13:10 rshadow joined #mojo
13:10 kwa What's the canonical way of checking if the request is going to be rendering a specific format, say JSON? I'm hooking into before_render and want to mangle the JSON only if that's what it's being rendered as.
13:11 kwa I'm currently just checking stash.format, but wondered if there was a more accepted method.
13:12 ramortegui joined #mojo
13:24 gizmomathboy joined #mojo
14:03 jberger at before_render time yeah, checking the format in the stash is probably the best
14:03 jberger (might need to look in the args too)
14:03 jberger also you might want to investigate the content negotiation stuff
14:04 jberger http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Content-negotiation
14:04 jberger and especially http://mojolicious.org/perldoc/Mojolicious/Plugin/DefaultHelpers#accepts
14:04 jberger but that kinda depends on your application
14:09 ptolemarch joined #mojo
14:16 mcsnolte joined #mojo
14:32 jlaffaye how can I pass the mode with hypnotoad ? -m does not work
14:42 jberger MOJO_MODE environment variable
14:42 jberger hypnotoad can only use environment variables or config values, cli flags wouldn't survive hot-restart for technical reasons
14:46 pink_mist 0_o but env vars will? 0_o
14:46 kwa jberger: Thanks. I read the rendering guide and about accept('json'), but that evals to true regardless because the Accept header for Chrome is: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
14:47 kwa Will stick with stash.format though, cheers.
14:48 jberger kwa, are you in control of the request from chrome?
14:48 jberger like if this is xhr, just set the accept header
14:48 jberger anyway, I don't know if you are attempting to do content negotiation or not
14:48 kwa jberger: Ah I get what you mean. No. The main purpose is to hijack the render to do some post-controller data mangling.
14:49 jberger ok, yeah, that's a different thing
14:49 jberger then yes, check the passed in args and the stash for format
14:50 jberger or for a json key
14:50 kwa Yeah. Checking format is fine, I just wondered if there was something like ->serving('json) I could use to check the content that's going to be rendered.
14:50 kwa Ah, I'm only checking the format. I'll make use 'json' exists in $args, too.
14:50 jberger the type that is going to be served is only determined during the render, by definition you are "before render" so that isn't known yet
14:51 jberger indeed, you might use before_render to change types
14:51 jberger (not that YOU would, but someone might)
14:51 batman joined #mojo
14:51 kwa Gotcha.
14:52 kwa Thinking about it, ->think_we_might_be_serving('json') is probably a saner method call. :p
14:56 Atog joined #mojo
14:56 Atog hi all
14:56 Atog I'm trying to do a xml rpc call that way: $self->ua->post("http://$hostname" => { Content_Type => 'text/xml' } => form => { body => '<?xml version="1.0" encoding="us-ascii"?><methodCall> ... </params></methodCall>' } => sub { ... }
14:57 Atog but mojo::useragent is adding the 'application/x-www-form-urlencoded' content-type too
14:58 Atog what's the way to avoid that content-type for being added?
14:59 jberger Atog: why are you sending xml as a form parameter?
14:59 jberger I think you are confusing something
15:00 Atog i'm trying to adapt a Anyevent script to mojo, and was to do the call that way
15:00 jlaffaye jberger: thanks, it works
15:00 jberger Atog: do you just mean for the xml to be the body of the request or does it need to be urlencoded?
15:01 jberger the form generator is for building a urlencoded body
15:01 Atog oh
15:01 jberger I'm going to guess that you mean this:
15:02 Atog so that's why the proper c-type is added
15:02 jberger $self->ua->post("http://$hostname" => { Content_Type => 'text/xml' } => '<?xml version="1.0" encoding="us-ascii"?><methodCall> ... </params></methodCall>' => sub { ... })
15:03 jberger in the future when something seems strange with the user agent, you can inspect exactly what it is doing by setting MOJO_USERAGENT_DEBUG=1 in your environment
15:04 jberger if you had, you would have seen a body like 'body=...%-encoded-xml...'
15:04 jberger which might have tipped you off
15:04 Atog yeah, that's it
15:04 jberger I use it all the time when I'm confused
15:04 Atog i took some stuff for granted that wasn't
15:04 Atog thank you jberger!
15:04 jberger np
15:05 jberger enjoy
15:05 jberger jlaffaye: cool
15:05 sri marcus: currently just playing with linux in vmware, but once i start at suse i will be using linux a lot ;)
15:08 sri not quite sure yet what my final linux work setup will look like, but i'll prolly talk a lot about it here while building ;p
15:08 sri for now i'm glad linux has made a lot of progress with hidpi support
15:09 sri gnome looks great in fullscreen vmware at native resolution on the retina screen
15:10 bpmedley joined #mojo
15:12 sri definitely the hardest part of working with linux is choosing a desktop environment :o
15:14 sri obviously i'm a opensuse tumbleweed person, i like my binary packages and always using the latest toys, so that was a no-brainer
15:21 sri so, the lenovo/microsoft story the other day was total bs Oo http://mjg59.dreamwidth.org/44694.html
15:26 disputin joined #mojo
15:27 lluad joined #mojo
15:29 PryMar56 joined #mojo
15:31 Grinnz well not total, but sensationalist certainly
15:32 Grinnz lenovo still locked the bios
15:36 genio now you can't get their baked-in spyware removed :) That was the _real_ motivation behind it and we all know it!
15:49 jberger I don't know if I would call it motivation, but they certainly aren't motivated to provide the additional resources needed to allow linux easily
16:25 sri that's true
16:40 dod joined #mojo
17:00 trone joined #mojo
17:09 trone_ joined #mojo
17:13 asarch joined #mojo
18:22 C joined #mojo
18:24 C As long as I change my secret, it's totally fine to trust session storage with non-secret stuff, right?
18:24 C just a user_id in there is enough to believe someone is the user with that id.
18:25 pink_mist C: the session will be signed with your secret
18:25 pink_mist it won't be encrypted though
18:26 Craftsmanship Yep - that's why I say non-secret
18:26 Grinnz it can be read by the user, but not changed
18:26 Grinnz (unless they know your secret)
18:26 Craftsmanship <_<
18:26 Craftsmanship >_>
18:26 Craftsmanship they better not!
18:30 jberger Craftsmanship: yes, that's a very common usage
18:32 good_news_everyon joined #mojo
18:32 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vidne
18:32 good_news_everyon mojo/master e135670 Sebastian Riedel: fix state transition bugs in Mojo::Transaction::HTTP
18:32 good_news_everyon left #mojo
18:33 pink_mist Craftsmanship: actually, the session cookie could be copied by a third party and it'd still register as signed
18:33 pink_mist but that'd require access to the cookie somehow
18:35 pink_mist either using the browser's session store, or seeing it crossing the wires by snooping on the communications (which of course could be prevented by https)
18:35 sri jberger: looks like i caused a regression with the state transition fix i applied for you a month ago -.-
18:35 pink_mist but there's not really that much you can do to prevent that
18:36 sri jberger: we never actually added a test case, so i almost broke it again ;p
18:36 sri this time the bug was that you could render 1xx responses with message body
18:36 jberger :o
18:37 jberger websockets are hard, lets go shopping
18:37 sri good news is that it seems like we got rid of a race condition on websocket close
18:38 sri as long as i can remember we had to accept 1006 here https://github.com/kraih/mojo/commit/e135670f129810a090ba38b0f74d079a32869854#diff-a3cb567ecd4d756d754d1baee62ee931L116
18:38 sri because the finish state was unreliable
18:39 jberger what is the $status = undef; for here? https://github.com/kraih/mojo/commit/e135670f129810a090ba38b0f74d079a32869854#diff-5e00c2b1d82e856c973e78c577272d6fR196
18:40 sri variable was used before
18:40 jberger oh
18:40 sri it's just a temporary variable for testing collected values in the callbacks
18:40 jberger without that 1006, where do you get the 1006 on unexpected close?
18:40 jberger is that somewhere else?
18:41 sri it's a constant from the spec
18:41 Craftsmanship pink_mist: so, I gues I should include some expire logic in there too?
18:41 jberger oh, nm, I read that whole thing wrong ;-P
18:41 Craftsmanship or do I get that by rotating my secrets?
18:41 jberger Craftsmanship: no, you do that by setting the expires in the session
18:42 jberger or there's a default in the Mojolicious::Session object
18:42 Craftsmanship you mean on the cookie, or as a key in htere?
18:42 jberger it gets put onto the cookie
18:42 jberger but it is in the session
18:46 pink_mist Craftsmanship: another thing you could do is store the remote ip in the session and validate it .. that'd require anyone using the same cookie to also have the same external ip, further ensuring that the cookie isn't used by a third party
18:49 lluad Be very careful with that. Users behind some sorts of NAT or mobile users will change IP address.
18:49 pink_mist (it'd require them to relogin every time their ip changes though, which might not be something they'd enjoy if they're on a device where that happens a lot, say a phone
18:49 pink_mist yeah
18:50 lluad AOL used to be the big example of that, but now it's mobile users.
18:50 sri or just a daily dsl reconnect
18:51 pink_mist indeed ... I heard that's very popular in germany
18:51 lluad Yeah. Makes running servers on consumer connections annoying.
18:51 sri it is, think permanent ip is considered a business feature that costs extra :)
18:54 sri on the plus side, we get a 55mbit flatrate for like 20 euros
18:55 Grinnz hmm.. don't suppose there's an easy way to add app-specific Mojolicious::Command::generate subcommands or am i just missing it?
18:56 Grinnz mostly just the name would be convenient :P
18:56 sri if you have an app specific lib dir
18:57 Grinnz yeah i could do the Mojolicious::Command:: structure i guess but i meant in the app's namespace
18:57 sri otherwise you'll have to make your own generate command and change the namespaces
18:59 Grinnz actually that wouldn't be too difficult probably
19:00 ramortegui joined #mojo
19:02 sri not at all
19:03 Grinnz package MyApp::Command::generate; use Mojo::Base 'Mojolicious::Command::generate'; has namespaces => sub { ['MyApp::Command::generate','Mojolicious::Command::generate'] }; 1;
19:04 Grinnz and had to unshift my app's command namespace rather than push it so it would find that one :P
19:10 sri argh, there is just no way the ghost in the shell movie next year can be good :S
19:12 preaction eh. they said that about Ghostbusters as well, and they were wrong. but they said that about Batman vs. Superman, and they were right...
19:18 sri wait, ghostbusters is good?
19:18 sri never watched it after seeing the rating on imdb
19:20 jberger I never could get a real bead on what people thought of ghostbusters because of all the brosplaining (or whatever we call this crap)
19:20 jberger as it was, I really never go see comedies in theatres anymore
19:20 jberger so I haven't seen it yet
19:21 Craftsmanship the what now?
19:22 genio That thing I used to pronounce as "thee-ate-er"
19:26 itaipu joined #mojo
19:30 Grinnz i only pronounce it that way when it's a chevrolet
19:33 lluad That's a fiine Chevrolet Theater you have there.
19:34 Grinnz https://www.youtube.com/watch?v=kZwhNFOn4ik
19:34 * genio was raised in an extremely country area.
19:34 genio shopping carts are "buggies"
19:35 genio One does not carry things, one "totes" them. etc.
19:35 Grinnz my mother calls water fountains "bubblers", mostly everything else has been new-englandizes
19:35 Grinnz ized*
19:36 preaction your mom's from wisconsin?
19:36 Grinnz bingo!
19:37 preaction that's a shibboleth that narrows someone's birthplace down pretty well. better even than "soda/pop/coke"
19:38 genio I still cringe visibly when someone says soda or pop
19:38 disputin joined #mojo
19:38 Grinnz i'm not used to pop, but coke i would just assume meant coca-cola :P
19:39 Grinnz i also hear some places call seltzer "soda water"
19:39 genio It was coke for everything except sweet tea. I think that's slowly changing though.
19:40 Grinnz i bet coca-cola's marketing department likes that one
19:40 genio Grinnz: Neither of those words were really ever used.  I don't think I knew what seltzer or soda water really were
19:41 Grinnz i was barely exposed to it as a concept, my parents hate seltzer
19:42 * jberger sips his La Croix
19:45 genio I don't think I really figured out fizzy water was a thing until I was in Italy and when I asked for a glass of water they asked if I wanted it with or without gas.  I was confused
19:46 genio We had two kinds of water: well water and city water.
19:47 Grinnz sri: re: the mailing list, i've seen that before when a team member had run a carton install incorrectly, i guess somehow a file had been created that confused morbo
19:47 Grinnz never was able to find out which file
19:48 Grinnz genio: same
19:48 Grinnz not the italy part, the well and city water part :P
19:51 genio My wife (then girlfriend) laughed at me about that for a while.
19:59 orev joined #mojo
20:09 polettix joined #mojo
20:22 aaa2016 joined #mojo
20:27 sri oops, the regression earlier is more serious than i though
20:27 sri t
20:28 sri responses to HEAD requests did not work
20:32 gizmomathboy joined #mojo
20:37 jberger yikes
20:38 good_news_everyon joined #mojo
20:38 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vid6L
20:38 good_news_everyon mojo/master 669d8fa Sebastian Riedel: this bug was a little more serious
20:38 good_news_everyon left #mojo
20:42 Craftsmanship joined #mojo
20:48 Craftsmanship If I want to do session stuff before dispatch to a controller, where would I find my ->session method?
20:48 Craftsmanship do I have to load it myself?
20:52 AirDisa joined #mojo
20:54 bpmedley Craftsmanship: Are you using a hook?
20:55 Craftsmanship I'm going to have to aren't I ... an under isn't going to cut it
20:55 bpmedley I'm not sure what you're after, so I dunno..
20:56 Craftsmanship Right now, before the rest of my dispatch I fetch a bunch of crap from APIs, user info, preferences, etc... but the user_id I use is just hard-coded
20:56 Craftsmanship it would work better if I got that from a cookie or something
20:57 Grinnz Craftsmanship: both the before_dispatch hook and an under route will get a controller object
20:57 Grinnz so the session should work fine
20:57 Craftsmanship o_O
20:57 Grinnz that sounds like a job for an under route
20:58 Grinnz just get what you need form the session, helpers, etc, then stash the results for the rest of the request
20:58 Craftsmanship it is one
20:58 jberger session in an under for authentication before routing deeply is maybe the most common usage of both under and session ;-P
20:58 Craftsmanship I didn't realise I could have a controller that earily
20:58 Grinnz of course, every request gets a controller before any routes are involved
20:58 Grinnz or i should say, dispatched to
20:58 Craftsmanship jberger: it seemed like it would be, my main question is about the way i'm holding the parts
20:59 jberger yeah, I'm just having a chuckle, you're fine (I'm a bit punch-drunk from work)
20:59 sri it's even a topic in the growing guide
20:59 Craftsmanship Yeah - It's not one of my controllers, it's just a Mojolicious::Controller ...
20:59 Grinnz not sure what that means
20:59 jberger I guess I see why that is confusing
21:00 Craftsmanship ref $c -> Mojolicious::Controller
21:00 Craftsmanship mine are My::App::Controller
21:00 Grinnz is your under route defined in a controller or as a coderef?
21:00 jberger Grinnz: because it hasn't dispatched to the final controller class it kinda seems like it wouldn't have the controller he/she/they needs (not sure of Craftsmanship's preferred gender)
21:01 Grinnz that shouldn't matter, either way you get the same helpers and stash
21:04 jberger right, but I still see why that might be confusing
21:10 jberger hmmm, this concept looks familiar :s
21:10 jberger http://www.redbubble.com/people/kowalskyo/works/16011056-uniperl-for-perl-developers?p=t-shirt&amp;ref=artist_shop_grid
21:11 Craftsmanship my under is a code-ref, but it's a bit goofy, 'cause it immediately drops into a ->delay
21:12 sri jberger: thae text on that image looks sketchy as hell
21:12 sri s/a//
21:13 sri like the image
21:25 sri judging by her dribbble portfolio, she can do better
22:16 jberger Krebs hit with >600GB DDOS
22:16 good_news_everyon joined #mojo
22:16 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vidFb
22:16 good_news_everyon mojo/master 0d17841 Sebastian Riedel: better tests for HEAD requests
22:16 good_news_everyon left #mojo
22:19 sri oh hey, another freenode netsplit, i guess irccloud will be offline again soon :/
22:20 jberger convos is looking better and better :-P
22:38 AirDisa joined #mojo
23:21 Craftsmanship joined #mojo

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