« Back to channel list

#elixir-lang - 25 May 2019

« Back 1 day Forward 1 day »
[00:08:44] orbyt_: has joined #elixir-lang
[00:12:14] griffinbyatt: has joined #elixir-lang
[00:15:32] Adkron: has joined #elixir-lang
[00:23:19] orbyt_: has joined #elixir-lang
[00:46:14] Adkron: has joined #elixir-lang
[00:48:51] Sgeo_: has joined #elixir-lang
[00:56:47] netrino_: has joined #elixir-lang
[01:16:00] netrino_: has joined #elixir-lang
[01:18:36] ephemera_: has joined #elixir-lang
[01:25:04] netrino_: has joined #elixir-lang
[01:28:46] Adkron: has joined #elixir-lang
[01:33:58] blahdodo: has joined #elixir-lang
[01:34:12] tomterl: has joined #elixir-lang
[01:52:08] nextloop: has joined #elixir-lang
[02:03:35] Adkron: has joined #elixir-lang
[02:04:02] netrino_: has joined #elixir-lang
[02:07:54] blahdodo: has joined #elixir-lang
[02:19:29] drincruz: has joined #elixir-lang
[02:19:51] thurloat: has joined #elixir-lang
[02:37:16] Adkron: has joined #elixir-lang
[02:43:27] netrino_: has joined #elixir-lang
[02:43:36] drincruz: has joined #elixir-lang
[02:51:31] mdbm: has joined #elixir-lang
[02:52:21] blahdodo: has joined #elixir-lang
[03:10:30] Adkron: has joined #elixir-lang
[03:18:18] fyber: Is there a way to set a global constant and access it from eex templates in Phoenix?
[03:21:54] fyber: Right now I set @name to "my string" in MyProjectWeb and then I'm accessing things with MyProjectWeb.name. It works fine but is there a better way?
[03:22:27] netrino_: has joined #elixir-lang
[03:27:27] notzmv: has joined #elixir-lang
[03:47:31] Adkron: has joined #elixir-lang
[03:56:38] wsieroci: has joined #elixir-lang
[04:01:27] netrino_: has joined #elixir-lang
[04:21:09] Adkron: has joined #elixir-lang
[04:37:05] mdbm: has joined #elixir-lang
[04:40:27] netrino_: has joined #elixir-lang
[04:44:13] jeffro: has joined #elixir-lang
[04:50:11] mdbm: has joined #elixir-lang
[04:50:42] blahdodo: has joined #elixir-lang
[04:57:12] blahdodo: has joined #elixir-lang
[05:03:20] Adkron: has joined #elixir-lang
[05:15:08] gvaughn: has joined #elixir-lang
[05:19:31] netrino_: has joined #elixir-lang
[05:33:04] kyrylo: has joined #elixir-lang
[05:41:01] Adkron: has joined #elixir-lang
[05:57:42] blahdodo: has joined #elixir-lang
[05:58:27] netrino_: has joined #elixir-lang
[06:06:45] mdbm_: has joined #elixir-lang
[06:08:06] mdbm_: has joined #elixir-lang
[06:19:09] kapilp: has joined #elixir-lang
[06:25:59] Adkron: has joined #elixir-lang
[06:28:00] gvaughn: has joined #elixir-lang
[06:37:31] netrino_: has joined #elixir-lang
[06:43:05] squall: has joined #elixir-lang
[06:57:58] Adkron: has joined #elixir-lang
[07:16:32] netrino_: has joined #elixir-lang
[07:17:09] snapet: has joined #elixir-lang
[07:26:14] kyrylo: has joined #elixir-lang
[07:28:16] gvaughn: has joined #elixir-lang
[07:37:44] Adkron: has joined #elixir-lang
[07:55:31] netrino_: has joined #elixir-lang
[08:05:08] gvaughn: has joined #elixir-lang
[08:05:22] Nicd-: fyber: put a function in a module, like: `def constant(), do: "value"`
[08:16:11] Adkron: has joined #elixir-lang
[08:31:11] blahdodo: has joined #elixir-lang
[08:34:32] netrino_: has joined #elixir-lang
[08:43:36] lexmag: has joined #elixir-lang
[08:56:09] Adkron: has joined #elixir-lang
[09:13:32] netrino_: has joined #elixir-lang
[09:26:50] mrus: The possibility to pattern-match a JSON response once again saved me dozens of lines of code. I still find it amazing how efficient it is to write code in Elixir.
[09:33:08] mrus: one question in regard to this: What's the best way to handle an else case for {:ok, pattern} = functionCall() ? I feel like a with or a case statement would be too much.
[09:34:24] m1dnight_: has joined #elixir-lang
[09:35:01] Adkron: has joined #elixir-lang
[09:39:45] netrino__: has joined #elixir-lang
[09:40:57] Phylock: has joined #elixir-lang
[09:45:04] gvaughn: has joined #elixir-lang
[10:18:46] Adkron: has joined #elixir-lang
[10:32:51] dimitarvp: has joined #elixir-lang
[10:36:45] tnez: has joined #elixir-lang
[10:38:14] mrus: benwilson512: any plans on releasing a new version of breifly on hex.pm btw? :)
[10:52:27] harrow: has joined #elixir-lang
[10:54:05] blahdodo: has joined #elixir-lang
[10:55:31] Adkron: has joined #elixir-lang
[11:07:44] __charly__: has joined #elixir-lang
[11:15:26] harfangk: has joined #elixir-lang
[11:21:11] kyrylo: has joined #elixir-lang
[11:22:50] gvaughn: has joined #elixir-lang
[11:27:38] Adkron: has joined #elixir-lang
[11:32:16] Sgeo_: has joined #elixir-lang
[11:48:51] nickjj: how would you go about looping over a list of items and keeping a running total so that outside of the loop, you have access to the total?
[11:49:50] nickjj: i know how to do this the non-elixir way (assign a var, do the loop, tally the var, return the tally'd total) but that doesn't work here since the tally'd var is never mutated
[11:50:34] jeffro: has joined #elixir-lang
[11:55:05] nickjj: here's a gist of what i'm trying to do in a non-functional way https://gist.github.com/nickjj/071ccf6baac624897f51978bafc348c4
[11:56:12] lexmag: has joined #elixir-lang
[12:01:44] nickjj: got it -- Enum.reduce came in handy, Enum.reduce(discounts, 0, fn(x, acc) -> x.price + acc end)
[12:02:35] blahdodo: has joined #elixir-lang
[12:05:23] Adkron: has joined #elixir-lang
[12:10:53] lexmag: has joined #elixir-lang
[12:23:28] Zarathu: nickjj: Enum.sum() also, if they're just regular numbers
[12:24:00] nickjj: yeah, i noticed that one in the docs, in this case it's a map
[12:24:10] Zarathu: if you're doing this kind of thing often, writing a sum_by/2 might be useful
[12:24:41] Zarathu: items |> reduce(fn item, acc -> second_arg.(item) + acc end)
[12:24:57] Zarathu: so you can just: sum_by(discounts, & &1.discount_amount)
[12:30:05] blahdodo: has joined #elixir-lang
[12:33:02] nickjj: that could come in handy
[12:34:06] lexmag: has joined #elixir-lang
[12:40:13] lexmag: has joined #elixir-lang
[12:47:04] Adkron: has joined #elixir-lang
[12:50:42] wsieroci: has joined #elixir-lang
[13:04:24] gvaughn: has joined #elixir-lang
[13:13:14] tuacker: has joined #elixir-lang
[13:13:33] tuacker: has joined #elixir-lang
[13:25:21] Adkron: has joined #elixir-lang
[13:44:07] tuacker: has joined #elixir-lang
[13:45:25] jeffro: has joined #elixir-lang
[13:45:50] tuacker: has joined #elixir-lang
[14:06:34] Adkron: has joined #elixir-lang
[14:11:16] mahmudov: has joined #elixir-lang
[14:11:26] netrino: has joined #elixir-lang
[14:14:52] blahdodo: has joined #elixir-lang
[14:15:25] Adkron: has joined #elixir-lang
[14:24:09] kyrylo: has joined #elixir-lang
[14:34:37] tnez: has joined #elixir-lang
[14:47:40] blahdodo: has joined #elixir-lang
[14:55:21] gvaughn: has joined #elixir-lang
[15:01:12] Adkron: has joined #elixir-lang
[15:13:06] tuacker: has joined #elixir-lang
[15:18:18] nickjj: before adding liveview to a mission critical component of my app, can someone let me know if there's another phoenix construct to pull off what i'm trying to do?
[15:19:14] nickjj: the short version is, i have a checkout form with a way for people to apply a discount code (text field + button), upon submitting that discount form, i'd like to update the main page's UI to reflect it (adding a LI tag, updating the price, adding a hidden form input to another form)
[15:20:23] nickjj: of course a page reload is out of the question, and wiring up an ajax call and then doing all of that UI work twice on the client with JS isn't fun -- so live view seems like an ok fit but other than that, there's nothing else available right?
[15:22:11] chrismccord: nickjj : instead of ajax, you'd use phoenix channels + a sprinkle of js
[15:22:29] chrismccord: but if you are avoiding the js part, then yeah LV is your choice
[15:22:52] nickjj: i don't mind a sprinkle of JS, but wouldn't the channel approach still require re-creating / modifying the UI in JS?
[15:23:38] nickjj: ie. i'd have an endpoint that returns back json which i'd parse client side and then assemble a few html tags to be added to the dom
[15:24:39] nickjj: best case scenario would be if i could somehow reuse the eex template in that endpoint and then the JS would only have to swap a div's content with new content
[15:25:01] hypercore: has joined #elixir-lang
[15:25:35] hypercore: hey guys, how does a library like swoosh interact with an auth framework (e.g. guardian/pow)?
[15:27:04] praveenperera: has joined #elixir-lang
[15:27:07] hypercore: i'm getting this error (although not sure exactly what's causing it): "could not fetch application environment MyAppWeb.PowMailer for application :my_app because configuration MyAppWeb.PowMailer was not set"
[15:42:20] Adkron: has joined #elixir-lang
[15:43:36] mahtob: has joined #elixir-lang
[15:43:40] hypercore: think i got it
[15:44:44] mrus: Does anyone know if there's a ready-to-use function for flattening a nested Map into a Map of key => value pairs? E.g. %{"a" => %{"b" => %{"c" => 1}}} into %{"a.b.c" => 1}
[15:46:37] mrus: (I know how to implement it myself, I was wondering if there was a built-in function)
[15:48:55] nickjj: chrismccord, thanks by the way. for some reason what you wrote lead me to looking at the docs for layouts and put_layout(false) will do the trick
[15:59:42] DTZUZU2: has joined #elixir-lang
[16:04:32] mahmudov: has joined #elixir-lang
[16:15:43] praveenperera: has joined #elixir-lang
[16:17:17] netz: has joined #elixir-lang
[16:17:30] lexmag: has joined #elixir-lang
[16:23:27] koollman: has joined #elixir-lang
[16:24:22] lexmag: has joined #elixir-lang
[16:24:51] Adkron: has joined #elixir-lang
[16:24:58] praveenperera: has joined #elixir-lang
[16:26:25] Robdor: has joined #elixir-lang
[16:27:11] RJ2: has joined #elixir-lang
[16:36:52] gvaughn: has joined #elixir-lang
[16:41:28] gvaughn: has joined #elixir-lang
[16:45:48] jeffro: has joined #elixir-lang
[17:01:56] FatalNIX: has joined #elixir-lang
[17:09:42] Adkron: has joined #elixir-lang
[17:16:20] Sgeo_: has joined #elixir-lang
[17:24:26] __charly__: has joined #elixir-lang
[17:28:40] kyrylo: has joined #elixir-lang
[17:29:41] blahdodo: has joined #elixir-lang
[17:51:20] Adkron: has joined #elixir-lang
[17:57:47] blahdodo: has joined #elixir-lang
[18:14:19] Sgeo__: has joined #elixir-lang
[18:17:24] wsieroci: has joined #elixir-lang
[18:18:53] wsieroci_: has joined #elixir-lang
[18:19:14] thurloat: has joined #elixir-lang
[18:19:27] lexmag: has joined #elixir-lang
[18:27:54] Adkron: has joined #elixir-lang
[18:30:24] jeffro: has joined #elixir-lang
[18:31:38] lexmag: has joined #elixir-lang
[18:36:35] _barcode_: has joined #elixir-lang
[18:44:55] praveenperera: has joined #elixir-lang
[18:46:45] squall: has joined #elixir-lang
[18:52:39] fastfresh: has joined #elixir-lang
[19:12:00] wsieroci: has joined #elixir-lang
[19:13:04] Adkron: has joined #elixir-lang
[19:16:38] squalloster: has joined #elixir-lang
[19:28:17] jeffro: has joined #elixir-lang
[19:51:04] kyrylo_: has joined #elixir-lang
[19:54:21] hypercore: has joined #elixir-lang
[19:54:27] benwilson512: mrus: I do not know of any built in function,
[19:58:42] Adkron: has joined #elixir-lang
[20:08:45] hypercore: has joined #elixir-lang
[20:25:27] praveenperera: has joined #elixir-lang
[20:29:27] weird_error: has joined #elixir-lang
[20:39:38] Adkron: has joined #elixir-lang
[20:41:42] blahdodo: has joined #elixir-lang
[20:51:25] mog: josevalim, i was curious when this https://github.com/elixir-lang/elixir/commit/51d1c4de4d534de205e8eb8d89a1a2c2dd3025aa would end up in a release?
[20:54:06] jeffro: has joined #elixir-lang
[20:59:40] josevalim: releases are twice per year, every jan and jul
[21:03:06] mog: i meant like the sub point release, i didnt realize it would be heald till 1.9
[21:03:17] mog: but thats fine thank you for information
[21:03:22] mog: and work in general
[21:07:01] blahdodo: has joined #elixir-lang
[21:14:35] helmut_1: has joined #elixir-lang
[21:16:33] Adkron: has joined #elixir-lang
[21:16:53] helmut_1: has left #elixir-lang: ()
[21:25:29] helmut_1: has joined #elixir-lang
[21:26:16] helmut_1: has left #elixir-lang: ()
[21:51:21] Adkron: has joined #elixir-lang
[21:51:31] targaf: has joined #elixir-lang
[21:59:30] jeffro: has joined #elixir-lang
[22:07:09] DanielI: has joined #elixir-lang
[22:36:33] Adkron: has joined #elixir-lang
[22:47:00] weird_error: has joined #elixir-lang
[23:09:50] Adkron: has joined #elixir-lang
[23:27:39] Promasu: has joined #elixir-lang
[23:35:18] tallysmartins_: has joined #elixir-lang
[23:54:08] Adkron: has joined #elixir-lang
[23:59:25] orbyt_: has joined #elixir-lang