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

IRC log for #mojo, 2016-06-09

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

All times shown according to UTC.

Time Nick Message
01:48 disputin joined #mojo
02:01 SmokeMachine hi! is there any plan to implement the minion "client" in any other language?
02:03 mattp SmokeMachine: I dont think so
02:03 SmokeMachine wouldn't be great if we could write minions in different languages?
02:04 mattp certainly
02:04 mattp i doubt the team would oppose a third party client, but i doubt itd be officially owned
02:05 SmokeMachine I was thinking about write it a nodes client... does it make sense?
02:05 mattp im just guessing though, not speaking for sri/jberger/grinnz etc
02:05 SmokeMachine *nodejs
02:05 SmokeMachine mattp: yes, I understand...
02:07 SmokeMachine but, does that idea make sense? (in your opinion)
02:35 noganex joined #mojo
03:15 che-quest joined #mojo
03:15 zivester joined #mojo
04:00 jberger SmokeMachine: you mean task definitions or the job runner or just to get information?
04:03 jberger The first would be hard, the second isn't really useful
04:04 jberger The third actually isn't hard if you just implement it over REST which isn't hard
04:04 jberger I have a module that could go to cpan at some point
04:06 SmokeMachine I mean the all tree...
04:08 jberger So you mean to port the whole system to node?
04:08 jberger If course you can, but why?
04:13 SmokeMachine But the most important would be é enqueue a job and run that job...
04:13 SmokeMachine I am writing son code that would be better if I could run some jobs in Perl and some others in node...
04:16 SmokeMachine In node I'm using a lib that feels like minion (imho)(but using mongodb) called mongomq
04:17 SmokeMachine I'd like to unificate those 2 queues...
04:18 SmokeMachine And make Perl serviceses enqueue js jobs and vice versa
04:18 SmokeMachine Makes sense
04:18 SmokeMachine ?
04:18 SmokeMachine jberger: ????
04:40 inokenty joined #mojo
05:48 cpan_mojo Mojo-WebSocketProxy-0.02 by BINARY https://metacpan.org/release/BINARY/Mojo-WebSocketProxy-0.02
06:13 kes joined #mojo
06:15 inokenty-w joined #mojo
06:45 andrew_ joined #mojo
06:59 icjs joined #mojo
07:04 Vandal joined #mojo
07:23 trone_ joined #mojo
07:25 VVelox joined #mojo
07:50 osfabibisi joined #mojo
08:48 trone_ joined #mojo
09:19 trone_ joined #mojo
09:58 meshl joined #mojo
10:09 sri hahaha, at first i thought that was the middle finger emoji
10:15 icjs joined #mojo
10:22 marcus ʕ•ᴥ•ʔ
10:47 mpapec any way to throw an fatal error if EV is not present?
10:47 sri "use EV;"?
10:48 mpapec tnx, I've already use that, but thought there is some config param :)
10:48 marcus sri: too complicated ;)
11:14 tchaves joined #mojo
11:16 dvinciguerra joined #mojo
11:42 Vandal is it me or morbo for windows became way more worse than a ~1 year ago?
11:44 sri unlikely
11:44 sri not many changes in the last year https://metacpan.org/diff/file?target=SRI%2FMojolicious-6.63%2Flib%2FMojo%2FServer%2FMorbo.pm&source=SRI%2FMojolicious-6.11%2Flib%2FMojo%2FServer%2FMorbo.pm
11:44 pink_mist I don't think most of us use windows, so ... could you elaborate in which way, Vandal?
11:44 sri had you said 3 years, then yes, there might have been signal handling changes
11:45 Vandal ok, 3 years maybe
11:45 Vandal I don't remember when I was using it last time on windows
11:46 sri https://metacpan.org/diff/file?target=SRI%2FMojolicious-6.63%2Flib%2FMojo%2FServer%2FMorbo.pm&source=SRI%2FMojolicious-4.12%2Flib%2FMojo%2FServer%2FMorbo.pm
11:46 sri lots of changes
11:46 Vandal pink_mist, he serves me cached teplates even changed and ignores Ctrl+C, Ctrl+X
11:48 sri but yea, very few of us develop on windows, so it tends not to be optimized for a nice experience there
11:48 Vandal got it
11:48 sri should be much better with bash for windows
11:49 Vandal git bash?
11:52 jberger SmokeMachine: if you ported all of minion and the pg backend to node
11:53 jberger Then you could in theory define jobs in either language and put them in per-language queues
11:53 jberger So that workers in that language would only dequeue jobs from that language
11:53 jberger But it seems like a ton of work
11:54 jberger Vandal: https://msdn.microsoft.com/en-us/commandline/wsl/about
11:55 Vandal jberger, isn't it windows 10 feature?
11:55 jberger Yes
11:55 Vandal I've got 7
11:55 jberger You can upgrade
11:56 jberger For free for free iiuc
11:56 Vandal and got myself 1 more headache?:)
11:56 sri well, then you gotta suffer with bad perl support ;p
11:56 jberger ¯\_(ツ)_/¯
11:57 Vandal I'll better use daemon and manualy restart it
11:57 Vandal yep
11:58 vicash Vandal are you sure git bash is using the correct perl
11:58 Vandal vicash, I'm not using git bash
11:58 vicash Vandal, which perl are you using on Windows ?
11:58 Vandal 5.20
11:58 vicash Vandal: strawberry perl ?
11:58 Vandal active
11:59 vicash Vandal: try strawberry and see if you have a difference
11:59 Vandal don't worry :)
11:59 Vandal I'm just fiddling with my bits
12:00 Vandal if I'll want to do something serious I can always fire up VM with Ubuntu
12:00 Vandal I was just curious abot morbo
12:00 sri it would be interesting to know which change resulted in morbo getting worse
12:02 Vandal yep
12:02 pink_mist \git bisect/
12:02 Vandal but I don't have the understanding of internals
12:03 sri this doesn't come up too often anyway, maybe it's not important
12:03 Vandal I'm one of this users that sees mojo like this: my code -> (MAGIC) -> Output
12:04 sri i suspect it's just signal handling on some versions of perl
12:05 nic just to put the other side of the discussion... during the past 18 months at least two people have commented on morbo getting better on Windows
12:05 sri heh
12:05 Adura They were likely using Strawberry.
12:05 nic yes
12:06 Vandal what is the minimal version supported by mojo?
12:06 Vandal 5.18? 5.14?
12:06 pink_mist 5.10.1
12:27 bpmedley What do y'all use for separating dev and production apps on the same box?  I'm thinking of using /opt and /dev.  Thoughts?
12:27 pink_mist /dev? 0_o uhhhh
12:27 nic what could possibly go wrong?
12:27 bpmedley Heh.. There's probably a better way.. :-O
12:28 bpmedley Maybe I should use ~/dev or somesuch
12:28 nic surely you're not planning to put them on the same port(s)?
12:28 pink_mist if you want to risk hosing your system, sure, use /dev 0_o
12:28 bpmedley nic: No, not same ports.
12:28 nic he means as a url path
12:28 bpmedley nic: Great point.  Those are directories.
12:28 nic oh, maybe he doesn't
12:28 nic omg
12:29 nic bpmedley: you do _not_ write your own stuff into /dev
12:29 sri hahahaha, /dev
12:29 cpan_mojo Mojo-WebSocketProxy-0.03 by BINARY https://metacpan.org/release/BINARY/Mojo-WebSocketProxy-0.03
12:29 bpmedley Is there alreadya  /dev directory?
12:29 bpmedley omfg
12:29 bpmedley No coffee yet
12:29 bpmedley I call those blonde moments
12:30 nic not sure it's ok to make that comment
12:30 bpmedley Hrmm, I'm only referring to myself.
12:30 nic calling blondes stupid is perhaps worse than destroying your system by writing into the wrong locations
12:30 bpmedley My bad.  I was flustered at my inability to remember that /dev was in use, and has been for a _while_.
12:31 bpmedley I'm calling myself stupid.
12:31 nic "bpmedley moments" would have been fine
12:31 bpmedley I call those bpmedley moments.. :-P
12:32 sri he bpmedley'd it
12:32 nic now that i understand the question... I run production from /srv and dev from $HOME/proj/...
12:33 bpmedley Hrmm.  I use /opt for /srv.  Perhaps srv would be better.  Yeah, I should use $HOME/something.
12:34 nic /opt was the Twentieth Century option, but it's really for 'big' apps like virus scanner, hardware packages, and wotnot
12:34 nic /srv is for services
12:34 bpmedley I like that better than the /opt bucket.. :)
12:37 * pink_mist runs prod from ~/sites/$proj and dev from ~/work/$proj :P
12:38 bpmedley pink_mist: Where do you put your conf files?
12:38 nic From a sysadmin perspective, /opt can be optimised for large, static files, sometimes even left read-only -- in every way the opposite of what you want
12:38 pink_mist bpmedley: depends on the project; usually ~/sites/$proj/$proj.conf
12:38 bpmedley nic: That's a good point.  Hrmm.  I think I'm going change to /srv over time.
12:40 bpmedley Right now my apps just sit in git repos.  What do y'all use for deployment?
12:40 bpmedley So, I may not want the conf file in the same git repo.
12:41 bpmedley By deployment I mean.. are each dev and prod directory a version controll'ed checkout?
12:42 nic It depends very much on the scale of operations
12:43 nic For a small one-man show, git hooks go a long way
12:43 bobkare We've been using vcs checkouts but are moving to building stuff with buildbot and deploying from <buildnum>.tar
12:44 nic the dev repo has lots of branches, one 'trunk' branch.  production has one branch and hooks that do stuff like gracefully reload hypnotoad upon commits
12:47 bpmedley Those are good ideas.. I, honestly, hadn't considered a production branch..
12:48 nic You can even keep the .git for production comletely separate; it's sits somewhere else on the fs without an attached working dir
12:53 Kripton joined #mojo
13:01 ramortegui joined #mojo
13:04 Vandal I can't install anything on 5.10, 5.14 have the same issues with morbo as 5.20
13:05 pink_mist 5.10 isn't supported
13:05 dod joined #mojo
13:05 pink_mist 5.10.1 is needed.
13:06 Vandal 5.10 is not excists
13:06 pink_mist what's the point of trying 5.10.1 though? I don't see how that's relevant at all
13:06 pink_mist it's not the perl version that matters
13:06 Vandal by 5.10 I meant 5.10.1
13:07 Vandal its not that obvious
13:09 kaare joined #mojo
13:16 sri there's a huge difference between 5.10.0 and 5.10.1
13:16 sri 5.10.0 is famous for being one of the worst releases ever
13:17 sri it's really cool how fast filevault has become
13:18 sri even with heavy ssd benchmarks like blackmagic there's pretty much no measurable difference with filevault active and inactive anymore :o
13:23 Perl702 joined #mojo
13:26 ranguard joined #mojo
13:29 zivester joined #mojo
13:30 Vandal 5.22.1 - same
13:30 Adrien Hi everyone! I need to use Mojolicious for my internship and I'm kind of left alone to find everything. I encountered the "EV doesn't work with ithreads" bug, and I found the answer in the FAQ, but I don't really understand what I'm supposed to do there. I'd appreciate if anyone here can help me.
13:31 sri it's not a bug, but an unsupported feature
13:31 sri you just don't use EV with an ithreads enabled perl
13:32 bpmedley Adrien: http://bmedley.org/mojo.pdf <-- would you consider
13:32 bpmedley Reading this?
13:32 Adrien thanks, I will
13:32 sri bpmedley: i don't see a reference to ithreads in there
13:34 bpmedley Gaw, bad support day by me.  I'll be quiet now.  I mis read what they wrote..
13:36 perlpilot bpmedley: IS that book a work in progress?
13:36 bpmedley perlpilot: yes, it's basically beta
13:38 * ashimema just found Mojo::Collection references in Mojo::Pg::Results..
13:39 * ashimema reads Mojo::Collection docs.. never seen Mojo::Collections before.
13:40 bpmedley ashimema: it's super sweet
13:41 ashimema I'm still trying to get my head around it.. was initially wondering why we need a replacement for straight arrays/arrayrefs ;)
13:41 ashimema but it's starting to make sense
13:41 ashimema adds some nice chainable methods
13:42 Adrien I'm trying to launch the lite_app using morbo so that it reloads, as instructed at the very start of the tutorial. I didn't change anything concerning ithreads or EV to do that, so I don't know how to "not use it"
13:44 bpmedley Adrien: what os?
13:44 Adrien windows (on a VM)
13:45 jberger bpmedley: not using EV isn't os dependent
13:45 sri Adrien: the snwer is right here http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#What-does-the-error-EV-does-not-work-with-ithreads-mean
13:45 sri MOJO_REACTOR=Mojo::Reactor::Poll
13:46 jberger Set that in the environment or else in a begin block
13:50 Adrien There is still the same error if it is in a BEGIN block, and I don't understand what you mean with setting it in the environment?
13:52 sri wonder if a patch like this would make sense for Mojo::Reactor::EV https://gist.github.com/anonymous/1935093b0ef5700bf038f07f1bfdfcf5
13:52 sri that would make it fall back to the poll reactor automatically
13:56 jberger Adrien: basically as seen here:  https://github.com/kraih/mojo/blob/master/t/mojolicious/lite_app.t
13:56 sri it would however prevent the use of EV with single process servers like the daemon command
14:00 sri oh, actually there's another option
14:00 jberger sri: i was just going to say that that is a bad trade off
14:01 Adrien jberger: , I still encounter the same message
14:02 jberger Adrien: Can you post the code you are using to a paste site and link it here
14:02 sri jberger: this one is more mojo https://gist.github.com/anonymous/0b964fd576a6b0f4c58257f353784321
14:03 sri that still allows MOJO_REACTOR=Mojo::Reactor::EV on windows for enforcing the backend
14:04 jberger sri: That one i like
14:04 jberger Especially since it gets rid of the CLONE method which i suspect has been part of the troubles for forkcall
14:04 asarch joined #mojo
14:05 Adrien http://pastebin.com/6iNkHQWY , I simply used 'mojo generate lite_app myapp.pl'
14:05 nic ashimema: A package I was working on (can't remember which) was feeling a bit awkward (in its API).  As an experiment I wrapped the return list in a Collection and suddenly it became fabulous.  Took me by surprise; then forgot to mention it here of course :)
14:05 jberger Adrien: try moving it above the use Mojolicious::Lite
14:06 ashimema Yeah.. I'm very quickly growing fond of collections.. not sure how I've come this far and missed them
14:06 Adrien Same result
14:06 sri ashimema: most discover them in Mojo::DOM
14:07 jberger Adrien: perhaps because you are using morbo you have to actually use the environment
14:07 bpmedley Adrien: you may need to use set at the CLI before running perl
14:07 jberger But i forget how to set the environment on windows
14:09 bpmedley Adrien: did set work?
14:11 good_news_everyon joined #mojo
14:11 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/voO0e
14:11 good_news_everyon mojo/master 9435232 Sebastian Riedel: improve Mojo::IOLoop to fall back to Mojo::Reactor::Poll if Perl has been compiled with fork emulation
14:11 good_news_everyon left #mojo
14:11 sri Adrien: it will get easier with the next release
14:12 sri that commit is for you :)
14:12 icjs2 joined #mojo
14:13 Adrien bpmedley: I was trying to search how to use the set actually
14:18 bpmedley c:> set MOJO_REACTOR=...
14:18 bpmedley c:> perl ...
14:22 sri just install the guthub version
14:22 sri s/u/i/
14:23 Adrien I'm supposed to use the version available on the company's servers
14:26 Adrien the set didn't change anything either
14:28 cfedde Was there a time when Mojo::Message::Response had a success method?  I seem to have used it but now it seems thatin Mojo::UserAgent I should be using the success on the $tx.
14:31 sri cfedde: not that i remember
14:33 bpmedley Adrien: maybe setx would help, I'm not sure.
14:34 cfedde sri: odd. I have code that seems to have been working with $tx->res->success. Or may be it was failing and I was ignoring it.
14:35 cfedde untested code path.  Coverage is god.
14:35 Bean joined #mojo
14:37 Atog joined #mojo
14:38 Adrien anyway, thank you all for your help, I'll just restart the server everytime I need to apply a change
14:41 bwf joined #mojo
14:42 jberger Adrien: :s
14:43 bwf A theory about "./script/app minion job" command.  If the job count in the "minion_jobs" table exceeds the "max_connections" setting in postgres, the command will throw an error.
14:51 sri i run tests with millions of jobs
14:55 bwf Does "./script/app minion job" work after those tests?
14:56 jberger bwf there isn't one connection per job
14:57 bwf Error here:  https://metacpan.org/source/SRI/Mojo-Pg-2.27/lib/Mojo/Pg.pm#L80
14:57 bwf Seems like _dequeue is called for each job
15:00 jberger that is dequeuing a DBI connection, which is different than dequeuing a job
15:01 jberger there is a pool of DBI connections
15:01 zivester joined #mojo
15:02 Trelane_ Is there a guide for CSRF with mojo?
15:03 bwf joined #mojo
15:04 jberger Trelane: http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Cross-site-request-forgery
15:06 Trelane Hmm.
15:06 Trelane (a) So the current best practice is to do this in the body of the controller's method? (not, say, by some kind of markup in the routing)
15:07 Trelane (b) Is there a way to do this with HTTP headers so I don't have to mess with the JSON being posted to the url?
15:08 jberger (b) is explicitly mentioned at the end there
15:09 jberger I don't know what you mean by markup in the routing
15:10 jberger I assume you could check it in an "under"
15:11 Trelane yeah, I think that's what I mean
15:11 bwf joined #mojo
15:11 Trelane And (b) isn't explict.
15:12 * Trelane will figure it out and then work out how to better document it
15:14 pink_mist "For Ajax requests and the like, you can also generate a token directly with the helper "csrf_token" in Mojolicious::Plugin::DefaultHelpers, and then pass it along with the X-CSRF-Token request header." <-- what's not explicit about that?
15:17 Trelane It doesn't show how to validate that nor how to pass that to, say, jquery
15:21 disputin joined #mojo
15:23 jberger I'm going to assume that if there isn't a different way to validate it that it validates the same way
15:24 jberger and there are plenty of descriptions of how to set a header using a browser-side user agent, isn't that outside of the scope of mojo's documentation?
15:27 sri yea, i think it's out of scope
15:27 jabberwok would be a wonderful blog post
15:28 sri suppose i wouldn't mind a minimal example for it
15:28 sri but it would have to be shorter than the first example
15:28 sri and that seems pretty hard
15:30 jberger jQuery gets pretty verbose once you aren't doing the standard stuff
15:31 jberger I keep meaning to find/write a browser-side useragent that I like for REST
15:31 sri yea, jquery example is definitely out of scope
15:31 sri or any other js lib for that matter
15:31 jberger XHR directly isn't going to help many people though
15:32 sri i don't actually care too much about it, just saying it now to Trelane doesn't put too much effort into something that will get rejected
15:32 sri s/t/s/
15:37 lluad joined #mojo
15:50 dod joined #mojo
16:12 disputin joined #mojo
16:15 bwf joined #mojo
16:21 bpmedley Trelane: https://gist.github.com/brianmed/90ea5d08ea5b50d9f292aba53de52d6d
16:22 bpmedley I hope i read you correctly, and this blurb is enough for showing what i do
16:24 jberger where that assignment into the json is because you are using the validator to validate the rest of your json too and by setting the input you were wiping the other behavior
16:25 bpmedley jberger: i'm confused, can you restate?
16:27 jberger your dance on lines 11-12 aren't actually necessary if you aren't going to validate the rest of the json using the validator
16:28 jberger at least I think that's how I read your code
16:28 jberger (and remember the discussion a while back)
16:28 jberger if that was truly necessary then the header isn't really working as documented
16:29 bpmedley Hrmm, perhaps i can create a better example after work
16:31 dvinciguerra joined #mojo
16:40 good_news_everyon joined #mojo
16:40 good_news_everyon [mojo] kraih tagged v6.64 at e9908b9: https://git.io/voOdm
16:40 good_news_everyon left #mojo
16:41 good_news_everyon joined #mojo
16:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/voOd4
16:41 good_news_everyon mojo/master 4785370 Sebastian Riedel: bump version
16:41 good_news_everyon left #mojo
16:54 bpmedley jberger: my reasoning for setting up the code like i did was so the csrf_protect and passed in json could be validated
16:54 GabrielVieira joined #mojo
17:07 jberger right, that's what I said :-P
17:10 tempire joined #mojo
17:11 jberger tempire: o/
17:11 tempire \o
17:11 tempire I'm really excited right now.
17:12 jberger oh?
17:12 * jberger happy dances anyway
17:12 tempire I've constructed an icmp packet from scratch, and deconstructed the ethernet and ip headers from a packet
17:12 * tempire feels the power
17:13 jberger be sure to use that power for good and not evil
17:13 jberger ok well maybe a little bit of evil, but don't go crazy
17:13 jberger :p
17:13 jberger that's some pretty low-level tooling you are getting into
17:13 jberger what is that for?
17:13 tempire I want to create a virus that lowers the priority of all jenna marbles video packets
17:14 jberger oh, but marbles and kermit are so cute
17:14 tempire I'm delving into desktop mac apps. As for what I'm using it for, that's an über secret
17:14 jberger https://www.youtube.com/watch?v=t4sXjJJjcWQ
17:16 tempire 8.6 million views
17:16 jberger I can't tell you how many people I've shown On The Floor to, thanks
17:16 tempire Oh goodness
17:16 tempire Time to rewatch that
17:17 jberger have you found the one where they sing it well?
17:17 tempire wat
17:17 tempire No I haven't!
17:17 jberger its funny because it actually sounds really good, but then you hear how terrible the lyrics are too
17:18 jberger https://www.youtube.com/watch?v=P8QJexZGYcg
17:19 bpmedley tempire: what language are you using for desktop apps?
17:20 tempire swift
17:20 tempire and c for the network stuff
17:20 tempire although you could use swift, one learning curve at a time
17:20 bpmedley Sounds fun
17:20 tempire swift is my favorite right now
17:21 * tempire hides from the raptor
17:28 sri ????
17:38 bwf 96 calls to DBD::Pg::db::_login from running "./app/script minion job".   http://i.imgur.com/HzuludL.png
17:38 ribasushi hm, that first video jberger posted
17:38 ribasushi it has the same beat/feel like "I like to watch" by church of euthanasia, so I claim "ripoff"
17:38 jberger I'm sure jenna is very worried :P
17:48 ptolemarch joined #mojo
18:07 ribasushi joined #mojo
18:10 Trelane So, I want to write $self->routes->post('/foo/bar/baz')->with_crsf->to('Foo::Bar#baz')
18:10 Trelane Now I can kinda do this with an under that goes *before* the post that checks the X-CSRF-Token header contains the csrf_token
18:11 Trelane so, two questions (1) Why can't I put the under after the post
18:11 Trelane (2) is there anyway to create new grammer so I can avoid writing ->under($imported_csrf_validation_sub_ref) everwhere
18:13 Trelane (without manually creating a new sub in the Mojo::Routes::Route namespace that is
18:13 disputin joined #mojo
18:16 jberger Trelane: under is a way to share code, you could just reuse the route that it returns to hang all of your csrf protected routes from
18:17 tianon joined #mojo
18:17 jberger my $protected = $self->routes->under(sub{ ... }); $protected->post(...); $protected->post(...); etc
18:17 jberger if you can't build your route tree that way for some reason then you can use shortcuts http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Shortcuts
18:19 jberger and now that I write that I should probably link you to the under section of the guide too http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Under
18:19 marty_ joined #mojo
18:19 jberger you can't have it after the post because that post is the leaf node in your route tree
18:19 jberger under can't be a leaf node and therefore can't come last
18:20 Trelane maybe I'm looking for a condition?
18:21 Trelane $self->routes->post('/foo/bar/baz')->over( csrf => 1 )->to('Foo::Bar#baz')
18:22 jberger I think a failing condition lets the route dispatch follow another branch of the route tree?
18:22 jberger that one I'm not sure of
18:22 jberger I haven't used conditions for anything real
18:22 Trelane So does an under, right?
18:22 jberger no
18:22 jberger a failed under halts the dispatch
18:23 Trelane so if I say ->under("/foo/bar") and it doesn't match...doesn't that just go onto the next one?
18:23 jberger (or could render early, like doing $c->render(text => 'failed csrf', status => 400); return 0; inside the under)
18:23 jberger no
18:24 jberger I THINK what you describe there is a condition
18:24 jberger but again I haven't used conditions in anger
18:24 sri jberger: that's what conditions are for
18:24 sri conditions are router extensions basically
18:25 Trelane can the condition generate a response?
18:25 Trelane i.e. a 400 crsf violation?
18:25 sri sure, they usually don't though
18:25 sri ->post('/foo/bar/baz​')->with_crsf->to('Foo::Bar#baz'))
18:26 sri that can totally be done with a shortcut and condition
18:26 jberger usually it would continue to the next route which itself would likely render something (assuming some other route matched)
18:26 sri you could even make it a plugin an put it on cpan
18:27 Trelane sri: I might do that, it might be easier than maintaining it in our main codebase
18:30 sri attaching csrf checks to individual routes seems rather unusual though
18:30 sri think more common would be a hook that checks all requests for certain http methods
18:31 sri like, a before_dispatch hook that checks all POST requests
18:39 tempire_ joined #mojo
18:51 jabberwok https://github.com/lindleyw/crud_example/blob/master/lib/CrudExample/Model/Message.pm#L45   i am rather pleased with my little Mojo::Pg subselect helper
19:13 ptolemarch joined #mojo
19:18 itaipu joined #mojo
19:26 perlpilot joined #mojo
19:39 PryMar56 joined #mojo
20:25 good_news_everyon joined #mojo
20:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vo3zY
20:25 good_news_everyon mojo/master e1a1742 Sebastian Riedel: update jQuery to version 3.0.0
20:25 good_news_everyon left #mojo
20:32 sri well, that was an easy upgrade :)
20:33 Grinnz_ huh, there's a 3.0.0 now?
20:33 sri as of an hour ago
20:57 sri jberger: so odd to see your presidential candidates insult each other on twitter
20:57 sri what a time to be alive
21:14 dmanto joined #mojo
21:30 nicomen their candidats already led reality shows, and set up private mail servers, the future is now
22:15 Grinnz_ Trump has been insulting other candidates for months on twitter, fits with the rest of his character unfortunately
22:15 preaction and by that you mean he "tells it like it is"
22:16 Grinnz_ lol
22:19 Grinnz_ it is really funny how similar his tweets are to an insecure teenager
22:19 Grinnz_ funny until you remember he has a chance at winning
22:20 disputin joined #mojo
22:20 Grinnz_ candidates have killed their entire careers just by doing/saying one of the myriad things he's said
22:25 sri hillary is not much better
22:26 preaction depends on where your frame of reference is...
22:26 preaction she, at least, can comport herself in a civilized manner...
22:27 sri honestly, to me hillary looks more evil at this point ;p
22:27 cfedde He'll be our first presedent who did not go to college.
22:27 Grinnz_ she's scary, but not deport-all-mexicans-and-muslims scary
22:29 cfedde she's being made to look scary by the technique of compounding apparent doubt.
22:29 preaction i mean, the US can have 4 more years of approximately what we have now, or we can have 4 years of Trump...
22:29 Grinnz_ the best hope is that hillary would be approximately what we have now
22:29 Grinnz_ there's really no telling what either of them would do to be honest
22:30 pink_mist eh, hillary won't rock the boat too much
22:30 cfedde At least Clinton has some respect for scientific evidence.
22:30 pink_mist but what you have now is still horrible, so
22:30 preaction and though i'm getting tired of the New Democrat, slightly-right-leaning, let's-compromise-our-principles-before-the-far-right-makes-us-do-it politicking, trump is a cartoon character in a suit
22:30 preaction like Judge Doom...
22:31 sri they're all cartoonish
22:32 pink_mist very true
22:32 Grinnz_ oh yeah the politcal cartoonists have a field day this election season
22:34 cfedde It would be funny if it was not so tragic.  If we beleieve Noam Chomsky we don't have another 4 years of denial left.
22:34 sri i liked sanders
22:35 cfedde The Trump/Ailes machine did not have to start in on making him look like a devil yet.
22:37 disputin joined #mojo
22:38 umask001 joined #mojo
22:43 dvinciguerra joined #mojo
22:45 punter joined #mojo
23:37 disputin joined #mojo
23:50 andy joined #mojo
23:56 jberger it is quite a time, that is true
23:57 jberger I'm no fan of Clinton, but she's the usual kind of problem, politics as usual
23:57 jberger he's a real problem
23:58 sri clinton seems a little more corrupt than the average politician
23:58 sri with the whole email deletion thing and basically being untouchable
23:59 sri you basically have the choice between evil (clinton) and crazy (trump)

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