<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
28 29 30 31
00:03 myronmarston joined
00:07 definiv joined
00:09 griffinbyatt joined
00:14 markw_ joined
00:15 LastWhisper____ joined
00:17 <LastWhisper____> hey guys would this be an appropriate place to ask about modeling tables for an elixir app using phoenix?
00:19 <zealsham_> why does 'yes" in ['world','yes','game'] returns true
00:20 <zealsham_> but 'y' in "yes" returns false
00:20 <benwilson512> single quotes aren't the same as double quotes
00:20 <benwilson512> which are you using?
00:21 <zealsham_> benwilson512: where can i post codes so i dont get to post codes here
00:21 <benwilson512> zealsham_: gist, pastebin, etc
00:21 <zealsham_> benwilson512: i used single quotes only
00:21 <benwilson512> zealsham_: single quotes largely exist to facilitate interop with older erlang libraries and functions
00:21 <benwilson512> right so
00:21 <cmk_zzz> LastWhisper____: database modelling is usually orthogonal to language and frameworks used. WHat database are you using?
00:21 <benwilson512> ?y in 'yes' will be true
00:22 <benwilson512> ?y is how you get the character for y
00:22 jkreeftmeijer joined
00:22 <benwilson512> so ?y in 'yes' can be read as "is the integer for y in the list of integers that make up the ascii yes"
00:22 <LastWhisper____> hey cmk_zzz I was just going to use the default postgres one ... I'm pretty new to database "architecting" if you could call it that
00:22 <benwilson512> generally elixir code will use strings which are the double quotes
00:23 <benwilson512> String.contains?("yes", "y") #=> true
00:23 <benwilson512> zealsham_: http://elixir-lang.org/getting-started/binaries-strings-and-char-lists.html
00:23 <zealsham_> benwilson512: https://pastebin.com/b9SFQ3rx
00:24 <benwilson512> `in` operates on lists
00:24 <benwilson512> 'yes' is a list of integers
00:24 <benwilson512> 'y' is also a list
00:24 <benwilson512> 'y' is not contained in 'yes', the list of integers
00:24 <benwilson512> `in` doesn't mean "is a subset"
00:25 <benwilson512> it means "is any of the items in the list equal to the thing on the left"
00:25 <benwilson512> I highly recommend reading the link I psoted
00:25 <benwilson512> it explains what the different data types are
00:25 sfbw joined
00:25 <cmk_zzz> LastWhisper____: ok. I'd start with some resources on database designs or database modelling. I don't know of any though
00:26 <cmk_zzz> LastWhisper____: if you have a quick question regarding database modelling I might be able to answer it hear but it is well worth reading up on it
00:26 <zealsham_> benwilson512: "it means its any of the items in the list equal to the thing on the left". wonderful explanation, irc is actually better than google for a beginner
00:26 sfaxon joined
00:26 <LastWhisper____> yeah i'd actually love some reading materials on db design/modeling. Sure I can give the jist of it, let me type it up real quick
00:31 InternetFriend joined
00:32 nighty-- joined
00:32 MotherFlojo joined
00:35 <zealsham_> bye everyone, will continue tommorow
00:36 <icecreamcohen> bye, zealsham_
00:43 r00tl3ss joined
00:46 __charly__ joined
00:50 elgenie joined
00:53 cschneid_ joined
00:59 Siyo joined
00:59 Siyo joined
01:04 mika__ joined
01:10 griffinbyatt joined
01:12 sunaku joined
01:20 papachan joined
01:24 isubasti joined
01:26 sfbw joined
01:27 rozap joined
01:31 griffinbyatt joined
01:34 mika__ joined
01:34 tomterl joined
01:35 sevenseacat joined
01:41 mozzarella joined
01:43 elgenie joined
01:50 jerel joined
01:52 sfbw joined
01:56 r00tl3ss joined
01:58 InternetFriend joined
01:59 jschneck joined
01:59 ssswitch joined
02:00 jhack__ joined
02:01 markw_ joined
02:01 LastWhisper____ joined
02:07 icecreamcohen joined
02:12 LastWhisper____ joined
02:13 sfbw joined
02:14 r00tl3ss joined
02:20 FMJaggy joined
02:22 LastWhisper____ joined
02:23 jkreeftmeijer joined
02:26 duane joined
02:31 __charly__ joined
02:31 MotherFlojo joined
02:32 muncman joined
02:36 <cmk_zzz> in ecto migration can I create a unique constraint? I think not? as it seems that only check and exclude can be specified. I know I can use unique index but I am replicating the migration of an existing database where unique constraints are used. They are slightly different
02:37 duane joined
02:41 <cmk_zzz> I use execute "ATLER TABLE t ADD CONSTRAINT name UNIQUE (column)" for now
02:42 <cmk_zzz> but then I can't reverse the migration :/
02:44 duane joined
02:45 <cmk_zzz> I guess it would almost be easier to just use execute for everything and manually create things in up, and manually drop things in down?
02:54 mika__ joined
02:56 akeating joined
03:00 LastWhisper____ joined
03:08 <asonge> cmk_zzz: yeah, you might just have to execute.
03:09 <cmk_zzz> asonge: would a pull request be welcome or is that something that is not going to be supported?
03:09 cschneid_ joined
03:10 <asonge> cmk_zzz: i don't know what that'd look like, really. iirc, a unique index auto-creates a constraint
03:10 <asonge> cmk_zzz: the differences between mysql and postgresql are probably going to matter here as well, and the migration API is supposed to map pretty cleanly across different database to some degree.
03:26 jerel joined
03:31 MotherFlojo joined
03:40 r00tl3ss joined
03:51 ramortegui joined
03:58 sp4rrow joined
04:06 Nycatelos joined
04:06 noplamodo joined
04:08 definiv joined
04:12 myronmarston joined
04:20 mika__ joined
04:24 jkreeftmeijer joined
04:27 cschneid_ joined
04:35 cschneid joined
04:36 fnux joined
04:39 fowlduck joined
04:39 noplamodo joined
04:44 refriedchicken joined
04:46 griffinbyatt joined
05:01 imack joined
05:04 dec0n joined
05:08 myronmarston joined
05:11 ariejan joined
05:13 sfbw joined
05:13 sp4rrow joined
05:15 samof76 joined
05:18 myronmarston joined
05:22 gvaughn joined
05:26 jkreeftmeijer joined
05:31 MotherFlojo joined
05:40 r00tl3ss joined
05:40 fowlduck joined
05:47 myronmarston joined
05:47 griffinbyatt joined
05:55 cemilowski joined
06:05 nd___ joined
06:06 isorehalav joined
06:08 definiv joined
06:13 sfbw joined
06:17 gvaughn joined
06:22 Reshi joined
06:22 josevalim joined
06:29 cschneid_ joined
06:41 fowlduck joined
06:43 samof76 joined
06:48 griffinbyatt joined
06:48 Ilyes512_ joined
06:56 notdaniel joined
06:56 flaviodesousa joined
06:57 r00tl3ss joined
07:01 duane joined
07:05 cemilowski joined
07:05 craigp joined
07:12 tuacker joined
07:14 sfbw joined
07:19 akeating joined
07:20 Ilyes512_ joined
07:20 fxn joined
07:24 nd___ joined
07:27 jkreeftmeijer joined
07:28 mattyw joined
07:31 mtsmmp joined
07:32 <mtsmmp> hey guys, i was wondering if i could run a small site on openshift free tier. could phoenix handle small to medium traffic without breaking?
07:36 <josevalim> most likely yes. people are getting 300req/s on a raspberry pi
07:36 PaReeOhNos joined
07:39 jkreeftmeijer joined
07:39 <mtsmmp> obrigado, jose. parabens pelo trabalho.
07:41 marr joined
07:41 fowlduck joined
07:41 <Nicd-> in my tests, I got a RPi 2 to serve over 400 req/s for a simple EEx page
07:42 <Nicd-> the database was the bottleneck
07:44 <Nicd-> with 700 websocket listeners that were sent info about every request, I could serve around 25 req/s that touched the database (as said the database was slowing it down)
07:44 <asonge> Nicd-: were you using Postgres or something?
07:45 <mtsmmp> nicd- in my case its a small website with 2500 products on the db. the traffic would be little initially but it could grow.
07:46 <mtsmmp> which db would be recommended? something lightweight on resources
07:47 <asonge> postgres is not actually all that bad...it can be tuned
07:47 asabil joined
07:48 <Nicd-> asonge: yes, with very minimal optimisations
07:48 <Nicd-> actually part of the test was to see how it would handle when the db is really slow
07:48 <asonge> yeah, that sd could easily have really bad latency on it
07:49 <asonge> sd card*
07:49 griffinbyatt joined
07:53 <Nicd-> I made a comparable service in PHP that executed the same DB calls and had the same websocket pushes with Ratchet and ZeroMQ
07:53 <Nicd-> it keeled over before 600 clients
07:56 PaReeOhNos joined
08:00 cschneid_ joined
08:02 duane joined
08:08 chrismccord joined
08:11 asabil joined
08:12 edmz joined
08:15 sfbw joined
08:17 isorehalav joined
08:17 m00dy joined
08:18 PaReeOhNos joined
08:19 tuacker joined
08:22 mtsmmp joined
08:22 m00dy joined
08:23 mirela666 joined
08:24 mark_66 joined
08:24 definiv joined
08:25 jkreeftmeijer joined
08:25 akeating joined
08:27 Guest67_ joined
08:33 jkreeftmeijer joined
08:34 gvaughn joined
08:35 jkreeftmeijer joined
08:39 isorehalav joined
08:42 fowlduck joined
08:45 akeating joined
08:45 TarVanim_ joined
08:45 lexmag joined
08:46 inoas joined
08:49 griffinbyatt joined
08:51 samof76 joined
08:52 southpawlar joined
08:52 mattyw joined
09:01 booyaa[ joined
09:03 akeating joined
09:03 ur5us joined
09:05 Ilyes512_ joined
09:10 srxa_ joined
09:17 <booyaa[> folks, is there an api for hex.pm? i'd like to do some package analysis, reverse dependencies i.e. find out what packages depend a package like poison or hackney
09:17 <ericmj> booyaa[: https://github.com/hexpm/specifications/blob/master/http_api.md
09:18 <booyaa[> ty!
09:28 jkreeftmeijer joined
09:29 Ilyes512_ joined
09:30 sfbw joined
09:36 elixir-lang586 joined
09:38 elixir-lang586 left
09:38 jkreeftmeijer joined
09:39 m00dy joined
09:43 fowlduck joined
09:44 jkreeftmeijer joined
09:48 bitmod joined
09:55 srxa joined
10:04 duane joined
10:05 cemilowski joined
10:08 harfangk joined
10:11 nbg joined
10:11 mika__ joined
10:13 gmcabrita joined
10:16 jkreeftmeijer joined
10:21 srxa_ joined
10:21 lexmag joined
10:24 manukall joined
10:26 jkreeftmeijer joined
10:27 jkreeftmeijer joined
10:30 soud joined
10:30 <soud> hey, when I use `timestamps()` in my model it saves them as UTC, what's the easiest way to have it use local time zone?
10:31 <soud> sorry, talking about Phoenix ^
10:31 <mrus> Is there a way in doctests to expect a result like {:ok, [<string>, <string>]} ?
10:31 <mrus> where string can be random strings
10:31 <ljarvis> soud: you should store them as UTC, and convert them to the user
10:32 <ljarvis> mrus: String.t
10:32 <Nicd-> ljarvis: depends on the situation
10:32 <Nicd-> soud: local time of the server or of the user?
10:32 <soud> Nicd-: server yes
10:32 <soud> ljarvis: ok, I thought so
10:32 <mrus> ljarvis: "Doctest failed: got UndefinedFunctionError with message "function String.t/0 is undefined or private""
10:32 <Nicd-> ah, in that case I would use UTC
10:32 ariejan joined
10:32 <soud> yeah, and convert it to local time in my view
10:32 <Nicd-> yes
10:32 <mrus> ljarvis: used this: {:ok, [String.t, String.t]}
10:32 <soud> thanks!
10:33 <ljarvis> mrus: oh sorry, I think I misread
10:33 <ciawal> ljarvis: <<_>> might do what you want
10:33 <soud> I guess that requires timex, or is there something in the standard library to convert utc to local timezone?
10:33 <ljarvis> mrus: you want to test that something returns {:ok, any_string, any_string}?
10:33 <ljarvis> ciawal: sorry?
10:33 <ljarvis> ciawal: oh, is that for mrus?
10:33 <Nicd-> soud: you need timex or lau/calendar
10:33 <ciawal> sorry it yes, mrus^
10:34 <mrus> ljarvis: exactly, yes
10:34 <soud> Nicd-: thanks
10:34 <mrus> ciawal: "(CompileError) (for doctest at) lib/croove_telephony/api/helpers/juggler.ex:206: unbound variable _"
10:34 <ljarvis> yep that'd do it
10:34 <ciawal> are you using = mrus?
10:34 <Nicd-> ljarvis: in my case I have to store timestamps as both UTC and user's local time :D
10:34 <mrus> ciawal: {:ok, [<<_>>, <<_>>]}
10:34 <ciawal> what's the whole line?
10:34 <mrus> yes
10:34 nbg joined
10:34 <mrus> what do you mean?
10:34 <ljarvis> Nicd-: yeah, i usually just store in UTC and them store the users timezone
10:34 <ciawal> what's your doctest line?
10:35 <ciawal> oh this is the iex result line?
10:35 <mrus> ciawal: yes
10:35 <mrus> it is
10:35 <ciawal> I think those just have to be constant :/
10:35 <ciawal> it's not a match
10:35 <mrus> oh noes :(
10:35 <Nicd-> ljarvis: I store the offset too but it's too expensive to combine UTC + offset when calculating aggregation stuff
10:36 <ljarvis> Nicd-: ah right, yeah i thankfully don't have to do that, i can't see it being painful without storing multiple timestamps though
10:37 mika__ joined
10:37 <mrus> ciawal: so, the only way to test that would be to write a separate function that checks for the input to be {:ok, [string, string]} and return true or false and then have the iex result line be true?
10:38 <ciawal> you should write a real test
10:38 nighty-- joined
10:38 <ljarvis> yeah, why are they random?
10:39 <mrus> because they're being generated randomly
10:39 <ljarvis> do they have a fixed length or other properties?
10:39 <mrus> yupp they do
10:39 <ljarvis> i'd just check that *shrug*
10:39 <mrus> fixed length
10:40 <mrus> but still in a test not a doctest, right?
10:41 <ljarvis> right, i would just use variables in a doctest to demonstrate usage and don't actually make any assertions, e.g. {:ok, random_thing1, random_thing2}
10:41 <mrus> the problem is that the doctest would fail then? At least I tried using variables and it didn't work.
10:42 <ljarvis> what happened? I guess to be honest my answer would be don't use doctests? just use an example without the iex prefix?
10:43 <mrus> okay, just wanted to make sure I got you right
10:43 <mrus> thanks
10:43 <mrus> well, I guess I'll do it the way you two suggested
10:43 <josevalim> yes, we typically don't include tests with side-effects in doctests
10:44 <josevalim> exactly because you need a whole infra-structure to set it up and then it is more of a test and than a DOCtest
10:44 fowlduck joined
10:44 <josevalim> *more of a test than a DOCtest
10:44 <mrus> I see. Well, I thought it was worth a try to use this shortcut, heh. :-)
10:46 <ljarvis> mrus: remember these things are documentation first, they should be as friendly as possible for consumers of that documentation, so adding complexity for the sake of using a doctest would to the detriment of your documentation
10:47 <mrus> ljarvis: totally true.
10:47 elgenie joined
10:47 MotherFlojo joined
10:47 <dmilith> Hello. I have a lil struggle. I need to do " echo | openssl s_client -connect XXX.XXX:443 2>/dev/null | openssl x509 -noout -dates" - but using Elixir (erlang). - thing is to check if "today is in range of validity of certificate used on external host". Do you maybe know such Hex packages or someone already did that without calling external processes?
10:47 m00dy joined
10:48 <dmilith> I'm like digging erlang docs.. so I'd need to write erlang callbacks for verify and just extend that verify with my check right?
10:48 akeating joined
10:48 <dmilith> but it sounds like a project in project, so guess someone already did that?
10:50 MotherFl1 joined
10:51 griffinbyatt joined
10:52 jhack joined
10:53 gvaughn joined
10:53 m00dy joined
10:56 <mrus> dmilith: you want an HTTPS client that verifies the SSL certificate?
10:56 <mrus> (or, gets some info out of it)
10:56 <dmilith> I have just a list of domains I need to traverse and check if validity date is >30 days
10:58 <dmilith> and because i need to use it on troglodyte-grade of backend like heroku.. I seek for native elixir/erlang implementation
10:59 <dmilith> it looks easy when you run check from the inside of the host - when you have access to cert files.. then yea. :public_key I guess
10:59 <dmilith> but I need to do it from external side.
11:01 <dmilith> oh. I've found this one https://github.com/deadtrickster/ssl_verify_fun.erl looks promising
11:02 stephen_m joined
11:02 <dmilith> but looking for Elixir implementation like this.. that's why asking here :)
11:03 <dmilith> maybe these.. https://github.com/sobolevn/awesome-cryptography#elixir
11:04 elmcrest left
11:04 <mrus> HTTPoison / Hackney utilize Erlang's SSL implementation for connecting, although I don't know whether they leverage the possibility to query individual info from the cert.
11:05 m00dy joined
11:06 <mrus> dmilith: http://erlang.org/doc/apps/public_key/using_public_key.html maybe?
11:08 <dmilith> yea, it just reminds me writing in C.. very low level
11:08 <dmilith> i thought it's like easy check in high level language
11:09 <benwilson512> well
11:09 <benwilson512> it isn't really a matter of high or low level
11:09 <benwilson512> it's a matter of what expections users have about ease of use and APIs
11:10 <benwilson512> some older erlang libraries don't have what many would consider today easy to use APIs
11:10 <dmilith> yea, and there's no check of validity days.. it's like basic stuff I guess. Especially for LetsEncrypt mess when certs have like 2 weeks of validity or 3 months..
11:10 <dmilith> that's why it's hard to believe for me that I can't find it
11:11 <benwilson512> but I mean you could write an C API that was like checkValidityDays(blah)
11:11 <benwilson512> so it's really an API design thing, not a high or or level thing
11:11 <dmilith> yea. That's of course last thing we want to do right? :
11:11 <benwilson512> hahaha yea
11:11 <benwilson512> for sure
11:12 <dmilith> I will find a way!.. Thans for your time :)
11:13 <benwilson512> good luck!
11:15 cevado joined
11:21 <dmilith> <3
11:23 johnhamelink joined
11:24 DeadTrickster joined
11:29 sillyotter joined
11:30 sfbw joined
11:32 sfbw joined
11:35 duane joined
11:35 griffinbyatt joined
11:36 jschneck joined
11:36 akeating joined
11:39 jkreeftmeijer joined
11:40 m00dy joined
11:40 MotherFl1 joined
11:41 flojo joined
11:41 seungha_________ joined
11:42 MotherFlojo joined
11:44 fowlduck joined
11:45 jschneck joined
11:52 cemilowski joined
11:59 dimitarvp joined
12:00 griffinbyatt joined
12:02 jkreeftmeijer joined
12:02 cschneid_ joined
12:06 srxa joined
12:08 samof76_ joined
12:13 bryanjos joined
12:13 cristianR_ joined
12:14 samof76 joined
12:17 gvaughn joined
12:19 akeating joined
12:20 <bitmod> benwilson512, what's the difference between utc_datetime and native_datetime and when should i use each?
12:23 <benwilson512> for ecto?
12:25 fxn_ joined
12:26 sfbw joined
12:29 duane joined
12:30 akeating joined
12:30 PaReeOhNos joined
12:30 jschneck joined
12:32 PaReeOhNos joined
12:36 <bitmod> benwilson512: yep
12:39 kiltzman joined
12:44 jschneck joined
12:45 fowlduck joined
12:48 elgenie joined
12:49 m00dy joined
12:52 MotherFlojo joined
12:52 gazler joined
12:52 ramortegui joined
12:56 m00dy joined
12:57 sfbw joined
13:02 sfbw joined
13:03 griffinbyatt joined
13:04 liveforeverx joined
13:04 alex88 joined
13:07 mbogda joined
13:07 mbogda left
13:12 fmcgeough joined
13:12 gvaughn joined
13:13 ssswitch joined
13:15 definiv joined
13:21 andersh joined
13:23 craigp joined
13:24 <benwilson512> bitmod: uh IIRC it's basically just whether or not it includes timezone information
13:24 <benwilson512> naive_datetime won't, utc_datetime will set the timezone as UTC, which is what you'd want to store in your DB most of the time anywya
13:35 jadlr joined
13:36 srxa joined
13:41 gvaughn joined
13:41 samof76 joined
13:43 gvaughn_ joined
13:44 alex88 joined
13:46 fowlduck joined
13:47 <bitmod> benwilson512: would it be ok to store any datetime related informtaion as a unix timestamp, then convert it in view/controller/frontend?
13:53 m00dy joined
13:55 flupke joined
13:56 mika_ joined
13:56 antipax joined
13:59 tuacker1 joined
14:01 <snuffi> naive_datetime will still save utc, i think.
14:03 cschneid_ joined
14:03 <snuffi> ah, i was wrong
14:04 <snuffi> btw, is there a library for extracting urls from text?
14:04 myronmarston joined
14:05 griffinbyatt joined
14:08 johnhamelink joined
14:16 <benwilson512> bitmod: you mean using the timestamp column type?
14:17 <benwilson512> yeah that's what I do, and use utc_datetime as the ecto schema type
14:19 jerel joined
14:22 <bitmod> benwilson512: ah, so something like "mix phoenix.gen.html Meeting meetings title:string timestamp:utc_datetime"? and and example value of timestamp would be 178292382932 or whatever?
14:24 Benjojo joined
14:26 tuacker joined
14:27 cdg joined
14:33 srxa_ joined
14:34 rodolfojcj joined
14:37 d10n-work joined
14:39 m00dy joined
14:40 Guest67_ joined
14:42 papachan joined
14:47 fowlduck joined
14:50 cschneid_ joined
14:50 elgenie joined
14:56 gvaughn_ joined
14:57 bitmod joined
15:01 jkreeftmeijer joined
15:06 griffinbyatt joined
15:10 booyaa[ joined
15:11 m00dy joined
15:12 myronmarston joined
15:15 jaydoane joined
15:16 jhack_ joined
15:17 meh` joined
15:18 mirela666 joined
15:19 __charly__ joined
15:20 cevado joined
15:25 t-richards joined
15:25 bitmod joined
15:25 cschneid_ joined
15:27 icecreamcohen joined
15:29 tuacker joined
15:32 m00dy joined
15:34 akeating joined
15:43 papachan_ joined
15:47 fowlduck joined
15:48 justelex_ joined
15:50 kansi joined
15:51 dimitarvp` joined
15:53 MotherFlojo joined
15:53 <kansi> hi, i am trying to move to phoenix 1.3.0-rc.1 but i keep getting the following error https://paste.fedoraproject.org/paste/mOfY6V00Kiv3cOnSXGVjAl5M1UNdIGYhyRLivL9gydE=
15:53 amclain joined
15:57 <gazler> kansi: bouncer is the problem here. You may need to override the phoenix dep with {:phoenix, "~> 1.3.0-rc.1", override: true}
16:01 wsmoak joined
16:01 jkreeftmeijer joined
16:02 rkazak joined
16:03 refriedchicken joined
16:06 PaReeOhNos joined
16:10 chrismccord joined
16:14 meandi_2 joined
16:17 myronmarston joined
16:20 cschneid_ joined
16:23 ionas joined
16:26 PaReeOhNos joined
16:28 nd____ joined
16:29 samof76 joined
16:30 jkreeftmeijer joined
16:35 cevado joined
16:36 jkreeftmeijer joined
16:37 griffinbyatt joined
16:39 papachan_ joined
16:44 maxbeizer joined
16:44 jeffweiss joined
16:45 definiv joined
16:48 fowlduck joined
16:49 srxa joined
16:50 rozap joined
16:52 elgenie joined
16:52 cemilowski joined
16:59 myronmarston joined
16:59 srxa joined
17:05 mika_ joined
17:06 OtherAllan joined
17:11 srxa_ joined
17:14 PaReeOhNos joined
17:21 jeseeq joined
17:24 proteus-guy joined
17:28 PaReeOhNos joined
17:32 fernandomm joined
17:37 griffinbyatt joined
17:38 nd___ joined
17:39 PaReeOhNos joined
17:40 fowlduck joined
17:41 myronmarston joined
17:42 josevalim joined
17:48 __charly__ joined
17:48 sunaku joined
17:49 justelex_ joined
17:52 myronmarston joined
17:53 fmccann joined
17:56 myronmarston joined
17:58 MotherFlojo joined
18:00 myronmarston joined
18:00 m00dy joined
18:01 <sunaku> is there a way to define an anonymous module? i want to define a throwaway module for use inside my test case
18:02 <benwilson512> you can just define a module within the test module
18:02 <gazler> sunaku: You can define a module inside your test module.
18:02 <benwilson512> heh
18:02 <gazler> You can use :code.purge if you want to get rid of it too.
18:02 <bitmod> benwilson512, is it possible to run two phoenix projects locally simultaneously?
18:02 <benwilson512> bitmod: on two different ports sure
18:03 <bitmod> benwilson512: strange, didn't work last time i tried. is the only thing you have to change the port in config/dev.exs?
18:03 <benwilson512> well or do System.get_env for the port
18:03 <sunaku> gazler: thanks, what if i need to create one per test? (i'm trying to create a dynamic Ecto Repo per each test)
18:03 <benwilson512> and have one terminal open with like PORT=4000 iex -S mix phoenix and then another tab that is PORT=4001 iex -S mix phoenix
18:04 <gazler> sunaku: You can use Code.eval_string and purge. Check out this module https://github.com/elixir-lang/elixir/blob/5297befe1f65538ca7cdc3960072a5ced79cff21/lib/elixir/test/elixir/kernel/warning_test.exs#L11L29
18:04 squallstter joined
18:05 <sunaku> gazler: thanks! that'll do perfectly
18:05 <gazler> https://github.com/elixir-lang/elixir/blob/50293b46f13a86328f0ffabdcbb8592e29ac24c6/lib/mix/test/mix/tasks/run_test.exs does it slightly differently.
18:05 maxbeizer joined
18:05 <ciawal> does :code.purge allow the same module name to be re-used in a test?
18:07 <bitmod> benwilson512: thanks
18:07 <OliverMT> josevalim: fun fact, I know the guy who has the @impl handle on github... he is getting a LOT of elixir hilights lately after @impl was introduced :D
18:07 <gazler> ciawal: I think you need :code.delete(M) too
18:07 <josevalim> oh no, poor him
18:07 <gazler> Where M is the module name.
18:07 <OliverMT> its githubs fault for doing @username
18:08 <benwilson512> josevalim: oh hey, got a sec for a phoenix channels / cowboy question?
18:08 <gazler> On the plus side, @impl does have an elixir library.
18:08 <benwilson512> you and chris are like the only two people in those git blames so
18:08 <benwilson512> josevalim: no is a perfectly fine answer
18:08 <josevalim> benwilson512: not at all, what's up?
18:09 <josevalim> *no problem at all
18:09 JuanMiguel joined
18:09 <benwilson512> the def connect callback in the socket definitely returns {:ok, socket}, but in the onresponse callback within cowboy the status is a 400, and the client sees a 400
18:09 <benwilson512> only happens in prod
18:10 myronmarston joined
18:13 rodolfojcj joined
18:15 <gazler> benwilson512: Is your server behind a proxy
18:15 <gazler> You need to forward the Upgrade and Connection headers if you are.
18:15 myronmarston joined
18:15 <benwilson512> couple of load balancers yeah, what's weird is that these exact load balancers work with other nodes
18:16 <benwilson512> it's public ALB => nginx => internal alb => nodes
18:16 <benwilson512> nginx I have the upgrade stuff in, used w/ other nodes fine
18:16 <gazler> Good alb or bad alb?
18:16 <benwilson512> uh good or bad meaning
18:16 <OliverMT> why the nginx in there?
18:16 <gazler> The old ones are bad. The new ones are good.
18:16 <OliverMT> out of curioisity
18:17 <benwilson512> gazler: elb bad, alb good
18:17 <benwilson512> they're new
18:17 <benwilson512> OliverMT: it has some fancy routing rules
18:17 <benwilson512> for handling different subdomains and what not
18:18 <benwilson512> that were not easy to express in albs
18:18 <gazler> Shouldn't be that then.
18:18 <gazler> And the origin check should cause a 403.
18:18 rkazak joined
18:18 <benwilson512> well what's weird is I figure if the headers were totally wrong, we wouldn't even get to the phoenix def connect callback
18:18 <benwilson512> but maybe i shouldn't assuem that
18:19 <OliverMT> benwilson512: aha
18:20 sfbw joined
18:21 sfbw_ joined
18:23 <benwilson512> actually
18:23 <benwilson512> I have a theory based on what you're saying
18:24 <benwilson512> I wonder if for some reason the domain is looking differently than is expected in my nginx config and it ISNT actually doing the upgrae
18:24 <benwilson512> is there an easy to identify header I should see on the phoenix side?
18:24 <gazler> For what? Websockets?
18:25 <gazler> Probably Upgrade?
18:25 <josevalim> benwilson512: is it in the browser? do you have the full requests/responses?
18:25 <benwilson512> client is the browser yea
18:27 inoas joined
18:30 jkreeftmeijer joined
18:34 zodiak joined
18:34 <benwilson512> ok it's definitely upgrade header related
18:35 <benwilson512> I used my little onresponse logger locally and it shows a {"connection", "Upgrade"} header locally, but there isn't one in prod
18:36 kzemek joined
18:37 Ven joined
18:41 PaReeOhNos joined
18:42 cschnei__ joined
18:43 ekinmur joined
18:47 imack joined
18:51 jimmyrcom joined
18:52 optikfluffel joined
18:53 elgenie joined
18:53 PaReeOhNos joined
18:55 optikfluffel joined
18:58 <benwilson512> ok
18:58 <benwilson512> definitely missing the upgrade header, which is wildly confusing because it works for non ECS nodes under the same ALB
18:58 <benwilson512> but at least I know that's the issue and can go from there
18:59 <benwilson512> added an onrequest callback and just inspected the cowboy request prior to any processing
18:59 <benwilson512> surprised the def connect callback still runs in that situation but
18:59 <benwilson512> at least I know what to look for now
19:00 flaviodesousa joined
19:06 wsieroci joined
19:07 jkreeftmeijer joined
19:08 icanhazbroccoli joined
19:09 icanhazbroccoli joined
19:09 icanhazbroccoli joined
19:09 cemilowski joined
19:11 rkazak joined
19:22 Ven joined
19:23 Gringill joined
19:23 ekinmur joined
19:27 PaReeOhNos joined
19:28 myronmarston joined
19:29 Ven_ joined
19:29 <Gringill> Hmm. I was under the impression that passing a function to Logger.info (and friends) allowed the calling process to immediately move forward, potentially doing work before the Logger finished evaluating the aforementioned function. Hence the "expensive to calculate warning" line in the docs. That seems to not be the case since logger.ex calls
19:29 <Gringill> normalize_message (which evaluates the function) before attempting to pass off the work to gen_event. With that being the case I am not sure what the benefit of passing a function as opposed to a binary is. Can anyone shed any light here?
19:30 mika_ joined
19:31 <benwilson512> no no
19:31 <benwilson512> the point of the function is to not do any work if the log level is not at that level
19:31 <benwilson512> Logger.debug(fn -> expensive() end) and the log level is info
19:31 <benwilson512> no expensive work is done
19:31 <Gringill> Oooooooooo man
19:31 <Gringill> THAT makes so much sense :D
19:33 <Gringill> I suppose if it worked the way I suggested it would break backpressure as well. Or at least be a back door.
19:33 <benwilson512> right I mean you can always backdoor it yourself
19:33 <benwilson512> spawn(fn -> Logger.blah(expensive()) end)
19:33 fernandomm joined
19:33 srxa joined
19:33 <benwilson512> not recommended however
19:34 <Gringill> Right, not what I want to do either. Was just trying to realign my expectations with reality.
19:34 <benwilson512> awesome
19:35 cmk_zzz joined
19:35 Ven_ joined
19:36 rozap joined
19:39 griffinbyatt joined
19:39 sfbw joined
19:40 jkreeftmeijer joined
19:43 oryman joined
19:49 lexmag joined
19:53 wsieroci_ joined
20:00 ur5us joined
20:01 Ven_ joined
20:01 josevalim joined
20:01 michaelwla joined
20:01 wsieroci joined
20:02 justelex_ joined
20:11 Tallys__ joined
20:12 <michaelwla> hello, I am looking for a recommendation on how to implement forms in Phoenix for data that I don't want to persist nor validate. Are Ecto Changesets the way to go?
20:13 myronmarston joined
20:13 <josevalim> michaelwla: you can still use Ecto.Schema without a database
20:13 jkreeftmeijer joined
20:13 <josevalim> or even a changeset without schema (search for schemaless changesets)
20:14 <josevalim> but if you would rather not have ecto at all, you can simply use the phoenix forms directly and pass @conn where you would pass @changeset
20:14 <josevalim> (in form_for)
20:19 <PaReeOhNos> Has phoenix 1.3 directory structure changed since https://www.youtube.com/watch?v=tMO28ar0lW8 ?
20:20 <josevalim> it mostly mirrors what is in the talk
20:20 <josevalim> there are some changes though
20:20 <josevalim> regarding nesting in directories
20:20 <PaReeOhNos> I've run a generator and noticed that the context module seems to now reside inside the context module? That presentation shows it outside
20:22 <PaReeOhNos> is that one of the changes or has something gone slightly wrong?
20:27 maxbeizer joined
20:27 <michaelwla> josevalim: thank you for your answer. I'll look deeper in the schemaless changesets then.
20:27 myronmarston joined
20:28 <josevalim> PaReeOhNos: that's one of them
20:28 <PaReeOhNos> josevalim: Ah ok great, thanks
20:28 jkraus joined
20:32 MotherFlojo joined
20:32 myronmarston joined
20:34 cdg joined
20:37 notdaniel joined
20:40 griffinbyatt joined
20:42 tuacker joined
20:45 wsieroci joined
20:46 PaReeOhNos joined
20:46 justelex_ joined
20:47 rkazak joined
20:48 jkreeftmeijer joined
20:52 refriedchicken joined
20:53 myronmarston joined
20:55 elgenie joined
20:59 asabil joined
21:01 sfaxon joined
21:03 Ven joined
21:06 __charly__ joined
21:07 myronmarston joined
21:10 srxa_ joined
21:18 inoas joined
21:20 sfaxon joined
21:23 myronmarston joined
21:28 jkreeftmeijer joined
21:28 sfaxon joined
21:28 sfbw joined
21:29 jeffweiss joined
21:29 myronmarston joined
21:33 sfaxon joined
21:37 sunaku joined
21:38 jhack__ joined
21:39 M232017[m] joined
21:43 sfaxon joined
21:44 sfbw joined
21:57 PaReeOhNos joined
21:58 nhooyr joined
22:03 myronmarston joined
22:06 sfbw joined
22:07 sunaku joined
22:07 sfbw_ joined
22:07 Blkt joined
22:16 myronmarston joined
22:17 srxa joined
22:22 mika_ joined
22:28 Cohedrin joined
22:30 jkreeftmeijer joined
22:32 definiv joined
22:33 sfaxon joined
22:40 Ilyes512 joined
22:45 LastWhisper____ joined
22:45 justelex_ joined
22:46 josevalim joined
22:46 cemilowski joined
22:46 elgenie joined
22:48 MotherFlojo joined
22:49 m00dy joined
22:52 maxbeizer joined
22:54 PaReeOhNos joined
23:04 srxa joined
23:05 cschneid_ joined
23:08 mika_ joined
23:10 MotherFlojo joined
23:12 cemilowski joined
23:17 griffinbyatt joined
23:23 sevenseacat joined
23:25 myronmarston joined
23:29 myronmarston joined
23:30 srxa_ joined
23:30 cschneid_ joined
23:32 myronmarston joined
23:33 jerel joined
23:37 sp4rrow joined
23:41 mika_ joined
23:43 myronmarston joined
23:44 Cohedrin joined
23:45 sp4rrow joined
23:48 myronmarston joined
23:51 cemilowski1 joined
23:54 myronmarston joined