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

IRC log for #mojo, 2015-09-01

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

All times shown according to UTC.

Time Nick Message
00:00 jontaylor joined #mojo
00:35 dominix joined #mojo
00:35 dominix hi there.
00:35 dominix anyone fluent with galileo ?
00:36 bpmedley dominix: We might be able to help if you just ask.
00:36 dominix how do I custumize ?
00:36 dominix like background picture ...
00:37 dominix style ? colors ?
00:45 bpmedley dominix: Could it be the Pagedown Extra Option?
00:47 bpmedley dominix: I just tried to install and configure Galileo-0.038 and had some issues.  I'm not sure what I'm doing wrong.
00:48 dominix I dont know, there is jquery, bootstrap humane.js whithin galileo. So I don't know which one set the background or so*
00:50 iloveyou joined #mojo
00:50 jb360 joined #mojo
01:02 jantore joined #mojo
01:29 jberger dominix: o/
01:30 jberger Yes customization is harder than it should be
01:31 jberger Any of the extra configuration options are good places to start
01:32 jberger Oh drat, (s)he left
01:33 jberger Anyway should they come back, basically the only thing to do would be to override the templates
01:34 jberger I'm not a front end designer, so trying to make a themable front end is ... well ...
01:35 jberger If anyone would want to help me on that, it would be nice
01:41 bpmedley jberger: You might let the user override the default boostrap.cs
01:48 jberger That is already possible
01:52 bpmedley https://pikock.github.io/bootstrap-magic/ <-- Could something like this be used to create a custom theme?
01:53 jberger I would assume so, but then again, I don't think it's just coloring that should be themable
01:53 jberger Layout is harder
02:12 noganex joined #mojo
02:16 ops2 joined #mojo
02:16 ops2 i am facing a very strange behavior from mojo
02:17 ops2 looks like a bug
02:18 bpmedley ops2: Do you have a smallish Mojolicious::Lite script to show the situation?
02:18 jberger ops2: feel like telling us what it is :p
02:18 ops2 i will try to describe , one momment
02:21 ops2 Controller: sub on_match_route { $self = shift; $self->call_sub($var); $self->call_other_sub($var); } sub call_sub {...} sub call_other_sub {...} <--- works fine
02:21 ops2 then
02:21 ops2 if i change it to:
02:22 bpmedley ops2: Can you create a smallish script?
02:23 jberger Dunno, I still kinda want tip hear the end of that thought
02:23 jberger *to (yes I'm on my mobile)
02:27 ops2 sub on_match_route { $self = shift; $self->call_other_sub($var); } sub call_sub {...} sub call_other_sub {... $self->call_sub($var) } < ---- gets the error: Compilation error at /usr/share/perl/5.14/utf8_heavy.pl line 447, then at random the error changes saying it can't find subs including the one that matches the route. Chaging the code back to the original that works makes no difference.
02:27 ops2 Restarting server makes no difference.
02:28 ops2 deleting the file contents and pasting the original code, make it work again
02:28 ops2 weird.
02:34 ops2 to be more correct: deleting the file contents > deleting all subs except the one that matches the route, run it, then paste the other ones back as in the first example
02:34 ops2 and everything returns to normal
02:35 ops2 making just the necessary changes do not make it work again no matter what i do
02:36 jberger Didn't we just see that error message before?
02:36 iloveyou joined #mojo
02:39 jberger http://irclog.perlgeek.de/mojo/2015-08-24#i_11108609
02:39 jberger Actual cause was a syntax error, though Dada didn't say where
02:42 ops2 i can't find any, but how come changing it back to the first example(that works) would make no difference if i don't do the voodoo?
02:44 jberger Do you have utf8 characters in the code? If so are they correct/complete?
02:45 ops2 i don't know mojo internals, but it is like after you get the first error mojo can't get rid of the code in memory and keep running the old code even if you change it and restart the server
02:45 jberger There are three instances of this error being reported previously via irc (says the log)
02:45 ops2 i'm just using a-z 0-9
02:46 jberger I don't know weekday that script is but I think it's masking errors
02:46 jberger s/weekday/what/
02:46 * jberger shakes fist at swipe type
02:48 jberger http://www.perlmonks.org/?node_id=1041047
02:49 kaare joined #mojo
02:49 jberger https://rt.perl.org/Public/Bug/Display.html?id=119459
02:50 jberger Did you miss a compilation error, like forget a my somewhere
02:50 jberger It is certainly a masking problem reading those
02:50 bpmedley ops2: Can we get a smallish Mojolicious::Lite example?
02:51 jberger As father c suggests do you have a later perl to test on?
02:52 jberger If not, as they suggest, add this:
02:52 jberger BEGIN { "\x{100}" =~ /[\p{XIdStart}]/ }
02:53 jberger No idea what it does, but it seems to unmask
02:55 jberger I'm comfortable saying its a perl bug and not a mojo bug though at this point
02:57 ops2 i just have this version of perl, i will post an example on pastebin later and will return here with the link
02:57 jberger Look for a syntax error somewhere
02:58 ops2 alright
02:58 ops2 see ya later
02:58 jberger o/ good luck
03:06 PryMar56 joined #mojo
03:26 inokenty-w joined #mojo
03:27 iloveyou joined #mojo
03:54 ops2 joined #mojo
03:55 ops2 The problem was a typo in one of the vars in had to pass to the sub
03:56 ops2 still weird the behavior it caused
03:57 ops2 jberger i tried removing "my" from an array in another controller and the same utf8 error followed by the strange behavior happened
03:57 iloveyou joined #mojo
03:58 ops2 should be something with the perl version if you can't reproduce it
03:58 ops2 see ya
04:01 cfedde_ joined #mojo
04:52 iloveyou joined #mojo
05:08 iloveyou joined #mojo
05:19 cpan_mojo Mad-Mapper-0.04 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mad-Mapper-0.04
05:37 memowe joined #mojo
05:53 memowe Good morning mojo! \o/
06:02 jontaylor joined #mojo
06:40 dod joined #mojo
06:45 dod joined #mojo
06:58 eseyman joined #mojo
07:05 dod joined #mojo
07:18 Jonis joined #mojo
07:32 Vandal joined #mojo
07:48 HtbaaPi joined #mojo
08:19 trone joined #mojo
08:20 berov joined #mojo
08:23 cpan_mojo Mad-Mapper-0.05 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mad-Mapper-0.05
09:08 AndrewIsh joined #mojo
09:09 mattp_ joined #mojo
09:29 meshl joined #mojo
09:35 refj joined #mojo
09:36 refj How to redirect to login page and after succesful authentication redirect back to requested page?
09:38 odc refj, store the requested page url somewhere (in the session, or directly in the url like /login?src=...)
09:39 refj odc: Thanks I will try that out.
09:40 pink_mist considering one can have more than one tab open to your site, storing it in the url sounds like a better idea than the session
09:40 odc indeed
10:29 Quai just make sure you dont blindly trust urls provided in the url.
10:37 refj Quai, I am pretty new to mojolicious and I am uncertain what Mojo module or method I should use to store the requested page in the url. Do you know where I can find an example?
10:39 Zoffix refj, when you find the user is not logged, just append the current page as a query var of the login page you're redirecting to
10:41 refj Zoffix: Ok, I will experiment with this. Thanks.
10:41 * pink_mist tends to have an under that rather than redirect to another page just renders the login page or takes care of the postfor logging in, so you never actually leave the url you're on
10:41 pink_mist s/postfor/post for/
10:41 Zoffix Right or that.
10:41 * Zoffix is still thinking in their good ol' ZofCMS ways :)
10:58 refj pink_mist, Would you mind sharing an example where you use an under to achieve this?
11:00 refj nvm, I need to go to a meeting and will probably loose my network connection. Thanks for the help guys.
11:24 refj joined #mojo
11:27 dvinciguerra joined #mojo
11:51 melo joined #mojo
11:54 jberger memowe: \o
11:55 jberger ops2: glad you got it, I'll try to remember this for the next time I see it
12:00 neilhwatson joined #mojo
12:09 mrEriksson Hey folks, I'm trying to figure out how to use Mojo::Pg to insert values in to an array column, but my google-foo seems weak today. Any pointers?
12:11 neilhwatson array column?
12:11 mrEriksson Postgres column with datatype array
12:12 neilhwatson What does the sql look like?
12:12 neilhwatson What have you tried?
12:13 mrEriksson Well, normally with DBD::Pg, you just bind a perl array on that position and you're all good, but with Mojo::Pg, that does not seem to work
12:13 mrEriksson From what I understand, Mojo::Pg seems to unroll arrays into multiple bind values instead. (Which is of course a good feature, but not really what I want right now)
12:14 asarch joined #mojo
12:14 jberger mrEriksson: it does just use DBD::Pg under the hood
12:15 mrEriksson jberger: I expected as much, but I guess it does some magic to the input before passing it along to DBD::Pg
12:15 jberger And I don't THINK it unrolls  array refs
12:15 mrEriksson According to the docs, it does
12:15 jberger Because I know you can use any(?)
12:15 mrEriksson any(?) ?
12:16 jberger Rather than in(?,?,?,....)
12:16 mrEriksson Ah
12:16 jberger But this exhausts my knowledge on the subject
12:17 mrEriksson Ohwell, I handcrafted the query instead, seems to work. Not all that pretty though :-)
12:35 Lee joined #mojo
12:37 asarch Bareword "Mojolicious::VERSION" not allowed while "strict subs"
12:37 asarch ?
12:38 asarch perl -MMojolicious -e 'print "Mojolicious::VERSION\n"'
12:39 neilhwatson Do you mean perl -MMojolicious -e 'print "$Mojolicious::VERSION\n"' ?
12:39 asarch Bingo! perl -MMojolicious -e 'print "$Mojolicious::VERSION\n"'
12:39 asarch Yeah!
12:39 asarch Thank you neilhwatson
12:39 asarch :-)
12:39 asarch 6.15
12:40 cpan_mojo BenchmarkAnything-Storage-Frontend-HTTP-0.001 by SCHWIGON https://metacpan.org/release/SCHWIGON/BenchmarkAnything-Storage-Frontend-HTTP-0.001
12:41 bwf joined #mojo
12:42 iloveyou joined #mojo
12:43 refj joined #mojo
12:44 jberger asarch: just run mojo version
12:44 asarch Thank you
12:45 asarch What OOP module does Mojolicious use, Moose, Mouse or Moo?
12:45 bpmedley asarch: Mojo::Base
12:46 bpmedley asarch: http://mojolicio.us/perldoc/Mojo/Base
12:46 jberger It's basically just lazy accessors with chainable setters
12:46 asarch Thank you
12:48 asarch "Can't locate object method "search" via package "Mojo::Loader" at /home/asarch/projects/fastnotes/script/../lib/FastNotes/Model.pm line 12."
12:48 jberger Note also that you can use Moo etc in your own code
12:49 bpmedley asarch: I'd have to see the code.  What are FastNotes?  :)
12:49 asarch http://github.com/koorchik/FastNotes-Proto
12:49 asarch I found that project in the wiki
12:49 asarch https://github.com/kraih/mojo/wiki/Example-applications
12:49 ajr_ joined #mojo
12:52 jberger 6.0  changed the Loader usage somewhat
12:52 jberger Perhaps that project hasn't updated
12:52 bpmedley asarch: I'm confused.  Are you trying to see an example app working?
12:52 asarch Yeah, I would like to know how the REST thing work
12:54 bpmedley asarch: http://blogs.perl.org/users/brian_medley/2014/11/using-minion-with-a-rest-api.html <-- Here is a small example
12:56 bpmedley asarch: Do you see how the under authenticates the api endpoints?
13:13 hernanGOA joined #mojo
13:14 ashimema anyone here using toadfarm..
13:15 mst "does anybody use X?" type questions aren't helpful, because people will often respond about code they don't use - so if you've got a specific question about X in mind, please move straight on to asking that instead
13:15 ashimema our op just asked if it can 'mount' difference apps under difference users with the SetUserGroup stuff?
13:15 eitz joined #mojo
13:15 ashimema lol.. I was just typing the question mst
13:16 ashimema i'm not seeing a simple way of doing that in my inital look.. so bascialyl wondered if anyone else it
13:16 jberger ashimema: batman is the author
13:17 ashimema aha.. so he is
13:17 neilhwatson send the bat signal!
13:17 jberger IIRC the SetUserGroup stuff is relatively new, perhaps propose such a feature?
13:17 ashimema :)
13:18 jberger then again, isn't there usually a sort of generic web service user?
13:18 mst the goal of toadfarm is to have multiple apps running within a single hypnotoad isn't it?
13:18 jberger what is the advantage of running apps as different users?
13:18 jberger mst: oh right, it might not even be possible
13:19 refj pink_mist: Would mind sharing an under example where you never leave the url you're on?
13:19 mst if you want multiple users, run multiple hypnotoads, one as each other, and I think the problem goes away
13:20 ashimema in theory it's more secure to have that seperaton of concerns..
13:20 ashimema personally it's outside of my scope
13:20 mst in practice if you have files on disk that belong to the apps, it's quite nice to make it so bugs don't make them overwrite each other's files
13:20 jberger ashimema: I would think that the web service user has very few rights as it is
13:20 ashimema very true
13:20 mst remember that anything that improves resilience against an outside attacker also tends to improve resilience against your own mistakes
13:21 ashimema very  true
13:21 jberger ah, good point
13:21 * jberger misses purl again
13:21 Adura Did purl swear?
13:21 jberger no, purl vanished
13:21 jberger but yeah, purl would probably be banned by now :-P
13:22 mst in #perl we consider gumbybrain an exception to the SoC rules since it's not intentionally producing those words
13:22 mst not sure whether you could apply that approach here though
13:22 mst which reminds me, I should take my own advice from last night
13:22 * mst sends email asking what's needed for purl
13:23 Grinnz mrEriksson, Mojo::Pg does not do anything special with array params (they would normally be passed as arrayrefs to DBD::Pg, they are passed the same way to Mojo::Pg)
13:24 Grinnz if you give an example of what doesn't seem to be working maybe I can help
13:25 genio poor purl, she's old
13:30 jberger mst++
13:32 gryphon joined #mojo
13:33 jberger so my "Joel is not a sysadmin" question of the day
13:33 kivilahtio joined #mojo
13:33 jberger if I only have a single core, say a tiny linode, does a preforking server do anything for you?
13:34 Grinnz jberger, there's still the benefit of handling multiple requests if one gets stuck on some form of I/O
13:34 jberger or more adaquately phrased, could I just use a $10 linode for demoing or should I go to the $20 per-month 2 core version straight away?
13:35 mst I'd use the $10 one with maybe 2 preforked processes
13:35 mst and then actually look at how it behaves under load
13:35 jberger I keep thinking I should have a server outside of my home
13:35 jberger mst: that's probably a good point, try it an see
13:35 * Grinnz uses his for lots of things!
13:35 jberger I had a linode available to me until last month
13:35 Grinnz however, mine has 8 cores <_<
13:36 jberger a friend that I did some dev work for let me squat on his, since he didn't have a ton of traffic
13:36 jberger but he has since decided to let it lapse, since his project stalled out
13:37 jberger Grinnz: high roller you are
13:37 Grinnz just a good deal i got from a friend :P it's not a linode
13:37 jberger I can't justify $80/mo on cable tv anymore, how would I justify $80/mo on a server
13:37 jberger ah
13:38 Grinnz also, only 10GB of disk space, most of the other VPSes have more than that
13:38 jberger I really don't need disk space
13:39 Onigiri jberger: kimsufi?
13:39 * Grinnz thinks $8 a month for netflix is a much better deal too
13:39 sri nooooooooo!
13:39 ashimema ?
13:39 sri looks like ruby will get a pipeline operator before perl5
13:40 kivilahtio joined #mojo
13:40 * sri is hearing the first rumours
13:40 jberger this is to make map/grep chains face the right direction?
13:41 sri yea
13:41 jberger we have Mojo::Collection for that
13:41 jberger we could write some sugar on top if we wanted to make it look like operators
13:42 jberger speaking of sugar, I should blog about Mojolicious::Plugin::Kavorka sometime
13:42 sri that's not the same at all
13:42 sri and it's not just for builtins
13:43 jberger Onigiri: I hadn't heard of kimsufi before, is it a real thing? I have heard enough good (and experienced with my friend's server) to think highly of it
13:44 Onigiri jberger: it's a child company of ovh.
13:44 Onigiri kimsufi is typically low level hardware with big disk for dirt cheap. For example the 7$/mo is a small atom dual core, 2gb ram, 500G disk.
13:44 sri http://learnelixir.com/blog/2014/10/10/experience-pipe-operator-in-elixir/
13:45 Onigiri It's around 25$/mo for a small i5-3570s, 16G ram, 1TB disk
13:45 sri ruby is taking stuff from elixir now
13:46 bd Onigiri: though only on ipv6 it seems
13:46 bd one even
13:46 Onigiri bd: my kimsufi has an ipv4
13:47 jberger I'm fine using ipv6 personally
13:47 jberger mostly I'm just writing demos
13:49 bd Onigiri: according to their faq you can not add ips to a server.
13:50 Onigiri At one point they used to let you add additional ip addresses, so as to make your vps appear to be in a specific country.
13:50 Onigiri Actually, not vps, dedicated machine.
13:51 jberger well, one other thing I guess, Linode sponsors perl things
13:51 jberger I guess I would rather pay a few extra bucks and support a perl supporter
13:51 Onigiri jberger: additionally there's crissic vps
13:52 jberger which kinda negates the other considerations
13:52 Onigiri They usually put a 25$/year vps up with 150G disk, decent ram etc
13:52 jberger Onigiri: doesn't bode well that I get an ssl cert error on their landing page
13:53 Onigiri Seems they got bought out, hah
13:53 Onigiri Well, there's always a bunch listed on lowendbox.com. (chicagovps is /shit/ though)
13:53 Onigiri Though I suppose if you like your vps randomly shutting off every few days
13:53 Grinnz batman, SQLite support for Mad::Mapper is cool :D
13:54 Grinnz batman, it's a shame DBD::SQLite doesn't have a more convenient way to get last insert ID other than the "select last_insert_rowid()" query or DBI's last_insert_id method
13:55 Grinnz which runs a query itself
13:55 sri <3 postgresql returning keyword
13:56 Grinnz indeed
13:57 Grinnz actually.........
13:57 Grinnz i think there is a way to get it automatically with an update hook on INSERT statements, ill have to look into that
14:05 Grinnz batman, if i manage to get the last insert id cached in the Results object, i'll add a last_insert_id method to it
14:06 Adura Onigiri, your opinion on lowendbox.com's DeepNet deals?
14:06 Onigiri Adura: I have no idea what that is
14:07 Adura Ah, was wondering if you had knowledge of providers other than ChicagoVPS.
14:07 Onigiri For vps providers, I've only used chicagovps, crissic, and flipper. Flipper was good, but expensive in the low end reaplm.
14:07 Onigiri Crissic was amazing, but seems they got bought out to get at their ip pool.
14:07 Onigiri And chicagovps is extremely oversold
14:08 Adura I bought into the $5.50 DeepNet deal recently.
14:08 jberger I must say, I'm sad to see someone besmirching the good name of Chicago in that way!
14:08 Onigiri Looks like that deal was posted in July.
14:09 Adura It's still being honoured, as of recently.
14:09 Onigiri So if they were a steaming pile like chicago, it would be rather clear at this point.
14:09 dod joined #mojo
14:09 Adura I have nothing to stress it, the BitcoinXT node chugs away seemingly fine so far.
14:11 mst chicago has a good name?
14:11 mst news to me
14:11 Onigiri Most providers frown upon bitcoin stuff.
14:11 Adura They mentioned mining in their ToS, so they seem to understand the difference between a node and mining.
14:11 Onigiri So you've just got a wallet, basically?
14:11 * jberger flings a hot dog at mst
14:11 Adura Naw, just a node to support the network.
14:13 Adura Only problem so far has been a few odd characters in ssh connections, which I can't really pin on them.
14:13 Adura It's just something I've never seen before.
14:18 bd besmirching. word. of. the. day.
14:18 bd what a successful day it was, i fought with icinga2. i learned besmirching.
14:19 melo1 joined #mojo
14:19 jberger bd++
14:27 batman Grinnz: cool! let me know or make a PR for mad-mapper :)
14:28 batman ashimema: no. i think it's even documented
14:30 batman ashimema: i can't find the documentation... the reason is that a process runs as a given user. not the application.
14:32 ashimema thought that might be the case..
14:32 ashimema k, thanks
14:32 batman you're welcome
14:32 batman Zoffix: i want to make a new release of assetpack. can you help me see if this commit is ok? https://github.com/jhthorsen/mojolicious-plugin-assetpack/commit/89c4568effd3d44b3f3ec7d6c47ff38a31313c3a
14:33 batman ...or any of the recent commits for that sake :) https://github.com/jhthorsen/mojolicious-plugin-assetpack/commits/master
14:33 * batman is stuck waiting for the bus to granada.
14:33 batman "for that sake"...? does that make sense? :P
14:34 Grinnz_ "for that matter"
14:36 jberger batman: enjoy, I'm jealous
14:37 batman Grinnz_: thanks! too hot in malaga for my brain to work (not sure if that's a valid excuse ;))
14:37 batman jberger: then we're even! hehe :)
14:38 salva joined #mojo
14:40 genio I'm jealous, too.  I would much rather be in Granada than here
14:41 mst batman: see you this evening then
14:41 batman yeah! not sure when, but if i will at some time start looking for beer in granda ;)
14:42 mst well, once you get here, there's Eligo paid for pizza and beer at the venue 7-9pm
14:42 batman Zoffix: i'm not making a release before you say "go"... i don't have any rush
14:42 mst I'm assuming we'll spread out from there
14:42 batman ok. cool
15:05 ashimema_ joined #mojo
15:13 disputin joined #mojo
15:20 sh4 joined #mojo
15:26 lluad joined #mojo
15:33 PopeFelix So, question I should have asked yesterday.  The web service I am communicating with handles authentication as follows:
15:33 PopeFelix 1) POST credentials
15:33 PopeFelix 2) receive auth token
15:35 PopeFelix Then in future requests, you are to send that auth token in a Cookie header, i.e. "Cookie authToken=webapi2-3759841272XXXXXX"
15:35 PopeFelix If I set this in the cookie jar, will this header be sent?
15:36 mst http://trout.me.uk/data.jpg
15:36 * PopeFelix groans
15:37 PopeFelix mst, was that in response to my question?
15:37 mst yes.
15:37 genio heh.  I like that one
15:37 mst genio: it's my fallback jpg for when I'm low on cats
15:38 genio it's odd that they'd choose to request the token via cookies rather than just a plain old Authorization header
15:38 PopeFelix genio, it's Oracle. Their size has made them crazypants.
15:40 PopeFelix Maybe it would be better to just do $ua->headers->cookie('Auth', $token)
15:40 PopeFelix or rather $ua->headers->cookie(qq{Auth=$token})
15:40 mst I would expect that to work
15:40 sri http://mojolicio.us/perldoc/Mojo/UserAgent#build_tx
15:41 mst also, you can trivially test this by strace-ing the script or similkar and watching the http traffic it sends
15:41 PopeFelix sri, thanks.
15:41 PopeFelix mst, i realized this after i began to ask the question. ;)
15:42 nicomen PopeFelix: yes
15:42 PopeFelix nicomen, yes, what? Yes, Oracle are crazypants?
15:42 nicomen mst: PopeFelix: set MOJO_USERAGENT_DEBUG=1 ./name-of-script.pl to get debug output
15:42 * PopeFelix teaches his autocorrect "crazypants"
15:43 PopeFelix nicomen, cool.
15:43 mst nicomen: noted
15:43 nicomen PopeFelix: yes if you set the cookie in a UA the header will be sent
15:43 mst I usually only remember thing-specific debugging tools if the general ones don't work though
15:43 mst strace -s16384 -f $program
15:43 mst saves me a lot of thinking
15:43 nicomen for heavier duty I like "tcpflow", which is tcpdump's simpler cousing
15:43 nicomen mst: nice
15:44 sri or dtruss if you're on a bsd/osx
15:45 mst turns out most of the time when I'm dealing with undebuggable stupid broken things it's on linux
15:46 mst BSD admins are less hassle on average ;)
15:56 shadowpaste "PopeFelix" at 217.168.150.38 pasted "Set cookies in UA" (9 lines) at http://paste.scsys.co.uk/497915
15:57 PopeFelix nicomen, setting a request cookie in the cookie jar doesn't seem to work. Maybe I misunderstood you.
15:58 Dandre joined #mojo
15:59 mst PopeFelix: um
16:00 mst why have you changed your code from what we said would work?
16:00 mst ->headers wopuld've been fine
16:00 mst if you're going to put it into the cookie jar you need a set-cookie like thing
16:01 PopeFelix mst, I was trying to understand what nicomen had suggested, that's all.
16:01 mst PopeFelix: right, but to add something to the cookiejar you need something set-cookie-ish
16:02 mst PopeFelix: which is Mojo::Cookie::Response
16:02 mst PopeFelix: which, you'll notice, is documented to have a max_age method
16:02 PopeFelix mst, gotcha
16:02 mst the cookie jar version expires things etc.
16:02 PopeFelix sure
16:02 mst whereas your header code would always send it
16:02 mst which might also be fine
16:02 mst but you can't try and set a cookie with a thing that isn't a set-cookie, that doesn't make sense
16:02 PopeFelix yeah, always sending it is what I'd prefer.
16:03 PopeFelix I was just trying to understand how the whole business worked.
16:04 nicomen PopeFelix: I _think_ request and response are the reverse of what you would think. So a server sends you a Set-Cookie request, and you provide the server a Cookie: response. I think that's why ::Response is what you need (wfm)
16:05 mst yes. hence why if he uses ::Response with the jar it'll work
16:05 PopeFelix Oh!  Yes, I see now.
16:05 PopeFelix OK.
16:06 PopeFelix Though I don't see the header happening when I set a ::Response cookie in the jar.
16:06 PopeFelix (and I set MOJO_USERAGENT_DEBUG)
16:07 mst PopeFelix: did your code set the right host etc. in the cookie so it knew the cookie was for that domain?
16:07 PopeFelix No, I didn't set a host at all.  That may have been my problem. :)
16:08 * PopeFelix 's understanding of cookies is clearly lacking.
16:12 mst PopeFelix: I would recommend reading the RFC
16:14 PopeFelix mst, I'll do that.
16:17 dvinciguerra_ joined #mojo
16:18 jberger :o
16:18 jberger github says that v6.17 is the 500th release!
16:18 jberger (by tag release standards of course)
16:19 sri :o
16:33 ZoffixWork joined #mojo
16:38 PryMar56 joined #mojo
16:41 meshl joined #mojo
16:42 asm35 joined #mojo
16:44 ZoffixWork batman, looks good, though a lot of that code is over my head, as I've not familized myself with all of Mojo docs :)  For the docs of SHIPPING thouhg, I think this line is not necessary http://bit.ly/1IEJ7gZ  Not everyone will have '.git'. There's a standard $ENV variable that could be used; I think it's $ENV{RELEASE_TESTING}, but I don't see an issue with that test running even in non xt/. Also, you should add a sentence below th
16:44 ZoffixWork at test's code about what it's doing. Took me a second to figure out. Just something like "Running that test will generate your assets." Though, I'm not clear why that test is running both `production` and `development` modes.
16:45 ZoffixWork My two cents :)
16:54 lsm joined #mojo
16:56 nicomen there's an AUTHOR_TESTING also I think
17:05 Grinnz_ AUTHOR_TESTING, AUTOMATED_TESTING, and RELEASE_TESTING are the ones dzil makes use of
17:05 iloveyou joined #mojo
17:08 PopeFelix So if I wanted to do a thing after every request, I could hook into the 'request' event in the Mojo transaction, right?
17:09 Grinnz_ there are several more specific request hooks that are described in Mojolicious.pm docs
17:10 PopeFelix OK, I'll look at those
17:11 PopeFelix wait, no. That won't work. I'm not using Mojolicious, just a Mojo UA.
17:12 PopeFelix But it looks like $tx->on(finish => ...) will do what I want.
17:12 neilhwatson mojo::pg question $resutls = $db->query( 'SELECT ?,?,? FROM ...', @params ), is that the correct format for the placeholder data: a plain array?
17:13 cpan_mojo CallBackery-0.2.6 by OETIKER https://metacpan.org/release/OETIKER/CallBackery-0.2.6
17:14 jontaylor neilhwatson: That would work, but technically its a list
17:16 jberger PopeFelix: use the UA's start event to attach to the tx's finish event and now you're cooking with gas
17:16 neilhwatson hmm called with 1 bind variables when 6 are needed.
17:16 jontaylor are there 6 entries in that array ?
17:17 PopeFelix jberger, I only have electric, you insensitive clod! ;)
17:17 Grinnz_ PopeFelix: oh, i misinterpreted your query.
17:18 PopeFelix jberger, in all seriousness, that's exactly what I'm going to do. :)
17:18 PopeFelix neilhwatson, are you passing an array ref instead of an array?
17:18 Grinnz_ neilhwatson: you always need to make sure the size of thelist of parameters after the query exactly matches the number of placeholders in the query
17:20 neilhwatson yeah, I'm sure its my array problem, but wanted to clarify what was expected from mojo::pg.
17:20 sri don't expect Mojo::Pg to behave different than DBI
17:35 batman ZoffixWork: I tried to explain it with "since you might forget to create the production/minified assets while developing."
17:37 batman Also, instead of "Running that test will generate your assets.", I wrote "To makes sure this is done, you can add a unit test that looks pretty much like this"
17:37 batman Anyhow... I will have a look tomorrow and see if I can make that clearer...
17:39 batman Do you see any issues with:     die $msg if $self->{die_on_process_error};    # prevent hot reloading when assetpack fail
17:42 batman Zoffix ^^
17:42 dod joined #mojo
17:44 ZoffixWork joined #mojo
17:45 ZoffixWork batman, yeah, what you originally wrote set me up expecting more than just a single ->get_ok() call, so it took me a bit to process why that call was being made. But.. up to you :)
17:45 jberger PopeFelix: :D
17:46 ZoffixWork batman, I'm fine with die message; it's annoying when morbo locks up in a loop due to SASS errors and I can't kill it :)
17:53 berov1 joined #mojo
17:54 disputin joined #mojo
18:01 batman ZoffixWork: Cool! I'll give it a go at work first, and then release sometime this week.
18:01 batman Will try to make more sense out of the doc.
18:02 batman Let me know if you have an alternative to the text. A total rewrite is fine.
18:02 batman (The test doesn't test anything. It just creates the assets)
18:07 * batman is in Granada. *afk*
18:16 ajr_ joined #mojo
18:24 sri Oo
18:25 sri this is odd... i've been testing another slurp variant, and -s $handle returns different values for a file that never actually changes
18:28 sri for 10 iterations i get 10949, 827, 4266, 1067, 3354, 313331113, 313331113, 313331113, 313331113...
18:29 jberger uhhhhh, whaaaaaa?
18:29 sri yea, my thoughts as well
18:32 sri oh no
18:32 sri lol
18:32 sri i messed up
18:33 sri *facepalm*
18:33 sri i just counted the values, and it's actually 15 being printed ;p
18:34 sri it's the built in templates being slurped when mojolicious is loaded by ojo
18:35 pink_mist heh
18:36 sri anyway, this was the idea https://gist.github.com/anonymous/f28834b1050c46b9b792
18:37 sri it's slower than before though
18:44 amon joined #mojo
18:48 chansen sri: Try to bypass the perlio layer, it's buffering
18:48 chansen open my $file, '<:raw:unix' or .croak(...)
18:49 sri doesn't apply to sysread though
18:50 chansen true, didn't see that
18:51 sri switching to read() and :raw:unix there's no performance difference to sysread() measurable btw.
18:51 sri at least in my little test case
18:53 sri so far the only case i've found that's actually faster is the single $handle->sysread(..., -s $handle, ...) call
18:55 disputin1 joined #mojo
18:57 chansen Perhaps it's time for a C/XS implementation or slurp_octets($path) and slurp_utf8($path)
18:57 pink_mist XS? in ///my/// Mojolicious?! :P
18:57 genio bite your tongue, sir!
19:00 jberger Is there an xs slurp that could be used if available? The the pure perl implementation's performance doesn't matter as much
19:01 Grinnz_ all the varieties i know of are pure perl
19:03 disputin joined #mojo
19:04 jberger same, but I thought perhaps chansen had a suggestion
19:05 chansen I could write one, but I guess there isn't any namespaces left on CPAN
19:05 Grinnz_ hah
19:06 pink_mist File::Slurp::XS
19:06 pink_mist :P
19:08 chansen Perhaps a synonym for slurp, My Apple dictionary doesn't have any :(
19:09 jberger guzzle
19:09 neilhwatson chug
19:17 pink_mist swig
19:18 NwBhy_ joined #mojo
19:19 Grinnz_ File::Quaff
19:24 genio no guzzle, that's a PHP project.
19:24 y1mmm joined #mojo
19:24 genio http://guzzle.readthedocs.org/en/latest/
19:28 jberger can't be swig, swig is a thing
19:28 * neilhwatson likes quaff
19:35 pink_mist yep, Quaff is nice
19:36 bd File::Slurper?
19:42 mishanti1 Feels kind of dirty integrating our mojo-app with Microsoft AssHurt Active Directory. :-/
19:43 mishanti1 Seems I spelled it wrong; Microsoft Azure
19:46 mishanti1 Btw, have anyone here got any input on modules for doing SAML, OAuth etc in mojo?
19:46 mishanti1 I see there are quite a few modules on cpan, but I get a 'pre-alpha' vibe from the documentation they provide.
19:47 meshl joined #mojo
19:49 jabberwok Quaff? ... the vessel with the pestle has the pellet with the poison...
19:49 genio can someone just steal the File::Slurp maintainer rights and fix it? so we don't have the need for all the others anymore?
19:50 jberger mishanti1: while I'm sure we empathize, please no language
19:51 genio and also add exceptions into cpan* to fix the silly version number problem for it as well?
19:54 Grinnz_ genio: people have been trying for a decade now
19:54 dexteruk_ joined #mojo
19:55 Grinnz_ when the maintainer is active but uncooperative, there's not much that can be done
19:56 genio yea, but since there hasn't been an update to it since 2011, can't it be considered abandoned and someone with the authority just "take" maintainer privileges :)
19:56 jabberwok there must be a procedure
19:57 Grinnz_ there is, and the maintainer refuses
19:58 genio jabberwok: There's definitely a procedure to adopt modules.  I'm not really talking about normal (sane) adoption, but outright thievery (quasi-rhetorical)
19:58 jabberwok thriller: "When Package Maintainers Go Renegade And Refuse Community Involvement"
19:59 mishanti1 jberger: Noted.
20:05 sri the procedure is called forking
20:06 pink_mist Grinnz_: if we start that curated cpan surely we can replace recalcitrant modules like that? :P
20:07 Grinnz_ naturally
20:09 sri i would leave the community if a cpan module was ever taken away from the original authors against their will
20:09 ZoffixWork joined #mojo
20:09 pink_mist it wouldn't be cpan
20:11 * ZoffixWork took over JavaScript::Minifier against the author's will :)
20:11 genio of course I wouldn't _really_ want it to happen, frustrated talk of a perfect world just includes such theoretical things fromt ime to time
20:12 ZoffixWork Well... it was more original author forgot he gave comaint to another author and when I email both him and the comainter, the comainter gave me comaint perms and I pushed the update, but then the original author finally responded, surprised I took over.
20:13 jabberwok i seem to recall similar issues with 'djbdns' about 15 years ago
20:15 pink_mist genio: it'd be a bit like opening pandora's box, except it'd start puffing out a little bit of hope, and then mountains and mountains of horrors and despair :P
20:16 pink_mist (but we're going a bit offtopic here aren't we? :/)
20:16 genio yes, sorry.  I'll be quiet now :)
20:17 sri this issue went a bit stale https://github.com/kraih/mojo/issues/830
20:50 Kogurr joined #mojo
21:02 refj joined #mojo
21:04 refj I would like to utilize "under" to render a login page if user is not logged in and return user to requested page afterwards. I'm pretty certain it has been done, but I've yet to find an example that implements exactly this.
21:14 dexteruk joined #mojo
21:17 ZoffixWork refj, see this ->redirect_to? http://bit.ly/1JLiB6i   Just add a query parameter of the page they were trying to access, and then in here http://bit.ly/1L27B5y you'd redirect to that query parameter instead of 'user/index' (if that param exists)
21:23 refj ZoffixWork, Thanks!
21:25 trone joined #mojo
21:27 ZoffixWork jberger, sri, moritz merged my pull to allow configurable channel logos and links on the web channel logs. I've also just sent them a PR for allowing channels to specify their GitHub repos so that references to #blah get properly links (closes this https://github.com/moritz/ilbot/issues/39)... So... once that's merged, bug him to configure #mojo :)
21:27 ZoffixWork beer time \o/
21:29 ajr_ joined #mojo
21:31 sri Zoffix++
21:35 meshl joined #mojo
21:38 Grinnz_ hmm, bug report, that regex only matches issue numbers with 2-6 digits, but github issues are commonly one digit :)
21:45 ZoffixMobile joined #mojo
21:47 ZoffixMobile Grinnz_, I noticed that by I left it the original way moritz had it. think it was intentional, to exclude things like "I'm #1!" et al. Each project would ever just have 9 issues+pulls (combined) :)
21:47 Grinnz_ the popular ones would, i guess
21:47 Grinnz_ but i don't see the harm in turning that into a link :P
21:48 ZoffixMobile :)
21:48 stephan48 in my issue bots i did not bother to filter that case. as the use of single digit tickets links outweights the occassional false positive
21:54 sri now i wonder what our first issue was :)
21:54 Grinnz_ cue grainy home movie footage
21:55 sri https://github.com/kraih/mojo/issues/1
21:55 sri hehe
21:55 sri that has since been removed actually ;p
21:56 Grinnz_ heh
21:57 sri the new RFC discourages their use
21:57 stephan48 https://github.com/kraih/mojo/issues/834 - i was about to say "uname -a" also is a good case to trigger #1 and then i find this!
21:58 Grinnz_ hah
22:15 jberger ZoffixMobile++
22:21 ZoffixMobile Wow. Cool. The background shift on GitHub's 404 page responds to me tilting my phone.
22:22 Grinnz_ Dev time well spent
22:23 ZoffixMobile Haha. Grinnz_++
22:25 stephan48 time for wipping up the 404 page: 10 min. doing all the cool animations: rest of the workday
22:57 Kogurr joined #mojo
23:11 * sri wonders if route conditions could use a complete redesign

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