« Back to channel list

#elixir-lang - 09 May 2019

« Back 1 day Forward 1 day »
[00:09:26] greengriminal: has joined #elixir-lang
[00:23:35] hrubi: has joined #elixir-lang
[00:52:09] __charly__: has joined #elixir-lang
[00:59:44] ryanhowe: has joined #elixir-lang
[01:03:39] jnoon2: has joined #elixir-lang
[01:05:44] jnoon2: has joined #elixir-lang
[01:06:07] carldd: has joined #elixir-lang
[01:47:04] craigp: has joined #elixir-lang
[01:53:38] tomterl: has joined #elixir-lang
[02:00:23] ariedler: has joined #elixir-lang
[02:19:12] Avinash: has joined #elixir-lang
[02:22:55] greengriminal: has joined #elixir-lang
[02:38:11] sdrew: has joined #elixir-lang
[02:43:53] __charly__: has joined #elixir-lang
[02:51:37] sacredfrog: has joined #elixir-lang
[02:57:14] Ninja3047: has joined #elixir-lang
[03:20:31] carldd: has joined #elixir-lang
[03:21:56] tnez: has joined #elixir-lang
[03:22:19] Saukk: has joined #elixir-lang
[03:29:43] mbuf: has joined #elixir-lang
[04:00:50] ariedler: has joined #elixir-lang
[04:01:12] Sgeo__: has joined #elixir-lang
[04:09:55] mog: has joined #elixir-lang
[04:13:19] gvaughn: has joined #elixir-lang
[04:14:14] harfangk: has joined #elixir-lang
[04:25:43] Avinash: has joined #elixir-lang
[04:48:20] jdpettit: has joined #elixir-lang
[04:52:03] Phylock: has joined #elixir-lang
[05:22:22] gvaughn: has joined #elixir-lang
[05:25:24] mbuf: has joined #elixir-lang
[05:45:46] gde33: has joined #elixir-lang
[06:00:04] za1b1tsu: has joined #elixir-lang
[06:00:47] mbuf: has joined #elixir-lang
[06:01:49] ariedler: has joined #elixir-lang
[06:10:50] zigpaw: has joined #elixir-lang
[06:32:14] gvaughn: has joined #elixir-lang
[06:34:51] Gazler: has joined #elixir-lang
[06:34:55] koollman: has joined #elixir-lang
[07:27:09] kyrylo: has joined #elixir-lang
[07:28:54] lexmag: has joined #elixir-lang
[07:46:48] gvaughn: has joined #elixir-lang
[07:50:54] garazdawi: has joined #elixir-lang
[07:53:49] micmus: gamache: if you haven't found solutions yet, killed usually means some linked process was "brutally terminated" with the untrappable kill reason. It's probably not the only process terminating you'll find in the logs
[08:02:23] ariedler: has joined #elixir-lang
[08:08:32] sevenseacat: has joined #elixir-lang
[08:08:43] jegaxd26: has joined #elixir-lang
[08:13:36] hrubi: has joined #elixir-lang
[08:16:52] voltone: has joined #elixir-lang
[08:24:16] gvaughn: has joined #elixir-lang
[08:58:22] mdbm: has joined #elixir-lang
[09:09:24] mdbm_: has joined #elixir-lang
[09:26:25] DeadTrickster_: has joined #elixir-lang
[09:29:32] lexmag: has joined #elixir-lang
[09:35:43] gvaughn: has joined #elixir-lang
[09:36:30] dysfun: morning folks
[09:37:05] voltone: has joined #elixir-lang
[09:38:25] jegaxd26: has joined #elixir-lang
[09:50:44] netrino: has joined #elixir-lang
[10:00:50] craigp: has joined #elixir-lang
[10:01:32] dysfun: what is a good first code editor for a windows user that will understand elixir?
[10:02:33] dysfun: hrm i guess
[10:03:24] ariedler: has joined #elixir-lang
[10:06:30] dysfun: which elixir plugin does he want OliverMT ?
[10:07:30] OliverMT: requires elixir to be in path of vscode
[10:07:37] OliverMT: dont remember what that entails
[10:07:44] OliverMT: I think it just has to be in default path of CMD
[10:08:01] OliverMT: I start my vscode from cmd.exe with vscode .
[10:08:08] OliverMT: because I need nif compilers available
[10:08:20] OliverMT: that is, I use the vistual studio build tool developer console wrapper for cmd
[10:08:25] OliverMT: inside conemu :P
[10:08:28] OliverMT: soon to be windows terminal
[10:09:43] Nicd-: piece by piece windows will be changed into a linux distro
[10:10:23] gonz_: And everyone will benefit <
[10:11:32] jegaxd26: has joined #elixir-lang
[10:12:28] gonz_: I switched back to my trusty XMonad-centric Linux workflow, but I have two Win10 Pro licenses and I'd be happy to use them in some context if Windows stops feeling like a second hand choice for dev
[10:13:14] lehoff: has joined #elixir-lang
[10:13:31] pmbauer: has joined #elixir-lang
[10:14:55] jkva: My google-fu is failing me; can I use pattern matching to ensure an argument is of a certain struct? Without inspecting its data much further?
[10:15:49] Nicd-: %Foo{} = ...
[10:15:50] gonz_: jkva: `def fun(%StructYouWantToMatch{...}) do ... end`
[10:15:50] jkva: e.g. in a GenServer, `handle_call(%some_struct_def, ...)`
[10:16:30] jkva: gonz_: I won't need to inspect any values in that case, right?
[10:16:57] jkva: That looks good, then. Thanks :)
[10:16:59] gonz_: Implicitly the `__struct__` field in the map will be checked (or so I've always assumed)
[10:17:12] jkva: Ah, I need to read up on how that works.
[10:17:20] gvaughn: has joined #elixir-lang
[10:19:32] dysfun: %Name{} matches %{__struct__: Name}
[10:19:36] kapil____: has joined #elixir-lang
[10:33:02] mdbm: has joined #elixir-lang
[10:39:31] jkva: dysfun: do you know if there's a list of builtin language functions / macros? I see an existing function being used called `struct` but I can't find where that is defined
[10:43:20] dysfun: Kernel is the stuff that's autoimported
[10:43:34] dysfun: https://hexdocs.pm/elixir/Kernel.html
[10:43:39] jkva: That should do it, thanks :)
[10:43:56] dysfun: the elixir hexdocs pages you'll want to bookmark
[10:44:18] jkva: You should see my open tabs
[10:44:29] dysfun: ha, i have thousands
[10:55:08] ariedler: has joined #elixir-lang
[10:55:27] work_: has joined #elixir-lang
[10:56:26] BitBot: has joined #elixir-lang
[11:17:33] lexmag: has joined #elixir-lang
[11:20:45] tnez: has joined #elixir-lang
[11:23:03] craigp: has joined #elixir-lang
[11:26:59] gvaughn: has joined #elixir-lang
[11:29:58] drincruz_: has joined #elixir-lang
[11:33:19] kyrylo: has joined #elixir-lang
[11:43:35] Sentreen: Hey guys, is there some way to force iex to not truncate long binaries (and to print them as strings)?
[11:45:12] Nicd-: use inspect with `printable_limit: :infinity`
[11:45:26] Nicd-: check the opts: https://hexdocs.pm/elixir/Inspect.Opts.html
[11:46:45] Sentreen: Right, but is there a way to automatically apply this to any value iex receives?
[11:47:16] Sentreen: Context: I'm a debugging session where erlport is throwing a lot of errors from python, which are trick to catch and inspect.
[11:49:43] Nicd-: https://hexdocs.pm/iex/IEx.html#configure/1
[11:50:21] Sentreen: That is exactly what I was looking for, thanks!
[12:05:01] nickjj: this article is nearly 2 years old, is a better method for sharing fixtures between modules available than what's been posted here? https://medium.com/@ejpcmac/sharing-fixtures-between-test-modules-in-elixir-15add7c7cbd2
[12:05:09] nickjj: in the testing docs for phoenix i wasn't able to find an example of this
[12:06:03] dysfun: i don't like fixtures at all, we generate our data in our tests
[12:07:24] nickjj: the docs mostly just say to inline functions that create resources for that specific file, but then you get yourself into the problem that the article covers
[12:07:43] dysfun: we have a bunch of extra libraries in test/support
[12:08:03] nickjj: is that online somewhere to take a look at?
[12:08:24] dysfun: no, but i can show you some of it i suppose
[12:09:37] dysfun: okay, so we have test/support/helpers.ex with a bunch of functions in for creating records in the database, they all use the bang variants so it errors if they failed to insert
[12:09:58] dysfun: this is ultimately powered by faker (at the minute), which is just a cheap way of generating vaguely realistic looking data
[12:10:21] dysfun: and we pass in a map of override values
[12:10:25] dysfun: i think i can show you one of these
[12:10:43] nickjj: code example would definitely help, i am 100% following you so far but i still get hung up with syntax at this point
[12:11:33] dysfun: https://gist.github.com/jjl/16d33bff9182486cbd7ef81eca67b505
[12:12:08] dysfun: this is used through User.changeset() and Repo.insert!()
[12:12:13] lexmag: has joined #elixir-lang
[12:12:31] nickjj: used as in, you just pass that in as an argument?
[12:12:31] dysfun: the Map.put_new_lazy puts a value from a function if the key is not already defined
[12:12:59] dysfun: User.changeset(%User{}, user(%{email: "hello@world"}) |> Repo.insert!()
[12:13:08] dysfun: like that
[12:13:23] dysfun: so we specify the fields we care about for this test and let it generate the rest
[12:13:26] nickjj: ah, so it ends up filling out a complete user, but you can overwrite whatever field you want on a per test basis?
[12:14:06] dysfun: we have a whole load of functions like that that generate data for all our models
[12:14:14] dysfun: and we override the fields we need to be a certain way
[12:14:25] ariedler: has joined #elixir-lang
[12:14:40] nickjj: how does &uuid end up turning into a uuid? do you have a private function in there that simply generates a random uuid with faker?
[12:14:46] dysfun: and we have the advantage of not having to keep open the seeds.exs or fixtures file at the same time
[12:14:48] nickjj: or a lib specific for uuids
[12:14:53] dysfun: yes, it's just a call to faker
[12:15:01] dysfun: def uuid(), do: unused(&Faker.UUID.v4/0, :uuid)
[12:15:14] dysfun: unused() is a helper i wrote that makes sure we get a unique one every time
[12:15:31] nickjj: any reason for that being outside of this user function but the name and phone are in user? are those 2 fields just specific to users but you use emails and is_admin all over the place?
[12:15:56] dysfun: pretty much
[12:16:33] dysfun: https://gist.github.com/jjl/825c5737616117f85d6d722267dea528
[12:16:47] dysfun: here are those utilities for making faker do what we want. i think that's everything it needs
[12:17:05] snapet: has joined #elixir-lang
[12:17:34] nickjj: thanks, that looks a bit more involved than what i envisioned in my head for guaranteeing uniqueness
[12:18:16] dysfun: heh, it was thrown together quickly because i needed some guarantees for my tests
[12:18:37] dysfun: these are the tests that don't benefit from full property testing
[12:18:44] dysfun: faker is much cheaper than full property tests
[12:19:01] dysfun: but it needs a little help to be really useful sometimes
[12:19:02] nickjj: yeah, i'm a big fan of faker (i've used it in other languages for tests and seeding development dbs)
[12:19:28] dysfun: anyway, these utils aren't that big :)
[12:19:49] nickjj: it's interesting, your strategy is similiar to what changelog.com is doing -- but i couldn't reverse engineer how a certain function was able to be called
[12:20:05] nickjj: because the code base didn't have a single function definition for the function they were calling
[12:20:36] dysfun: testing this way is really convenient
[12:20:42] dysfun: and it puts the test data right next to the test
[12:21:03] nickjj: is there something magical in phoenix tests about the function named "insert"?
[12:21:14] dysfun: not that i know
[12:21:17] nickjj: because they have examples like this all over their tests: ep1 = insert(:published_episode, title: "The Best", subtitle: "Evar!")
[12:21:27] dysfun: have they imported Repo ?
[12:21:38] nickjj: but it's the same strategy as you explained , it creates a published episode and overwrites the title/subtitle on demand
[12:22:01] nickjj: but then they also use it like this to make a different resource: p = insert(:podcast, slug: "jsparty")
[12:22:01] dysfun: it's more like we don't fill them if they're there in our case, but yeah :)
[12:22:42] nickjj: to my limited understanding they only alias Repo
[12:22:56] nickjj: which means they need to explicitly use Repo.insert in that case right?
[12:23:57] PragTob: has joined #elixir-lang
[12:24:07] dysfun: i haven't looked, but i'm guessing they start with a `use` which inserts that behind the scenes
[12:24:18] dysfun: i don't like hiding stuff away like that
[12:24:23] nickjj: they have this: https://github.com/thechangelog/changelog.com/blob/master/lib/changelog/schema/factory.ex
[12:25:00] nickjj: and then they import that factory in their support/data_case (they renamed it to schema_case) https://github.com/thechangelog/changelog.com/blob/master/test/support/schema_case.ex
[12:25:06] dysfun: yeah that use at the top of ExMachina i'm guessing imports the repo
[12:25:06] nickjj: would that give the effect of being able to call insert without needing Repo?
[12:25:37] dysfun: import Foo # call Foo.* without prefixing Foo.
[12:25:56] dysfun: they do use ExMachina.Ecto, repo: Changelog.Repo
[12:26:26] dysfun: use is a macro i'm guessing they have made do an import Changelog.Repo
[12:26:53] nickjj: ah, so it's really exmachina making all of this work the way it does?
[12:27:13] nickjj: in the sense that, this factory module becomes something you can use in the way they use it
[12:28:01] dysfun: a `use` can do whatever it wants, it's just a macro
[12:28:48] nickjj: going by the docs maybe exmachina isn't even needed if you set up your own fixtures/etc. with faker?
[12:29:00] dysfun: we don't use ExMachina
[12:29:18] dysfun: we just use faker and exunit
[12:29:58] dysfun: im not sure why exmachina makes a big show of it
[12:30:05] nickjj: thanks, now most of this makes sense
[12:30:18] nickjj: if anything it's an abstraction of your strategy (whether it's good or bad is debatable)
[12:30:37] dysfun: yes, i think that's fair
[12:30:58] nickjj: personally i'd rather have ~50 lines of test support code i own than pull in something like that
[12:31:03] dysfun: i just needed shit to work, i didn't have time to buy into a paradigm shift lol
[12:31:33] dysfun: and as you can see, my "library" is pretty small
[12:32:15] craigp: has joined #elixir-lang
[12:32:27] sacredfrog: has joined #elixir-lang
[12:33:01] mdbm: what is the difference between "use" and "@behaviour", why do I write use GenServer and not @behaviour GenServer
[12:33:05] nickjj: btw, why did you put it in test/support/helpers.ex and not test/test_helpers.exs?
[12:33:20] nickjj: also thx for the help, that should be enough to get going
[12:33:28] dysfun: isn't that test/test_helper.exs , a script for starting your tests?
[12:33:43] nickjj: maybe, i should probably read the docs on that
[12:34:17] dysfun: vs test/support (a library directory) containing a library we can alias/import
[12:36:30] dysfun: actually i slightly lied. the fake data generators are in test/support/fake.ex and we wrap them together with a call to changeset and repo.insert in test/support/helpers.ex
[12:37:34] nickjj: so that user function from before ends in fake.ex?
[12:37:46] dysfun: yes, that's from fake.ex
[12:37:55] lexmag: has joined #elixir-lang
[12:37:56] dysfun: in helpers.ex we have fake_user(opts)
[12:38:14] nickjj: and you ultimately call that in your tests?
[12:38:14] dysfun: the helpers module is imported, whereas the fake module is aliased, typically
[12:38:28] dysfun: yes, i'm typically calling fake_* in my tests
[12:38:38] gvaughn: has joined #elixir-lang
[12:39:10] nickjj: just for completeness would you be able to provide an example of fake_user(opts) in helpers.ex?
[12:39:20] nickjj: i'm guessing it's a 2 liner, but just doing a sanity check
[12:40:22] dysfun: https://gist.github.com/jjl/f9e48e95beadbbc8dfa71c2ef7424914
[12:40:41] dysfun: others take a map of options, but in this case, the only thing we care about is is_admin
[12:42:35] nickjj: in the map of options case , instead of is_admin would it be options \\ %{}?
[12:42:48] sacredfrog: has joined #elixir-lang
[12:42:51] dysfun: it would if none of them were mandatory
[12:43:19] dysfun: i.e. if you're content to let all of them be generated by faker
[12:44:24] dysfun: some of them take the mandatory arguments first then the last is an optional overrides map
[12:44:30] dysfun: whatever was required at the time
[12:45:14] nickjj: so like this then? https://gist.github.com/nickjj/9b3ab019700006d56dffd2305abd83f1
[12:45:25] dysfun: (this is how we handle foreign keys, for example, you pass in the fake user to make the fake shop etc.
[12:45:59] sacredfrog: has joined #elixir-lang
[12:46:08] dysfun: so the test would start e.g. u = fake_user(%{is_admin: true}) with it like that
[12:46:58] nickjj: i hate to keep bugging you, but a FK example would be very very useful atm
[12:47:41] dysfun: https://gist.github.com/jjl/0ef432faf1a4f072521573a32edc59c9
[12:47:43] nickjj: passing in a fake user to make a fake shop is something i'll for sure be doing
[12:47:49] dysfun: that's from fake.ex
[12:48:10] dysfun: in our case it's users and tenants are linked together rather than users and shops
[12:49:01] nickjj: does the fake_user_tenant function look pretty much the same as the fake_user gist?
[12:49:37] dysfun: actually i never got around to writing that one yet :)
[12:50:06] dysfun: but i expect it will take three parameters: (user, tenant, overrides \\ %{})
[12:50:29] dysfun: this is decidedly where personal taste takes over
[12:51:23] nickjj: ok, i think that's enough to run with, really appreciate it
[12:51:51] dysfun: if you still like it in a week, please write the blogpost so i don't have to ;)
[12:52:38] nickjj: haha, i was actually about to say "hey, if you have a blog, you should make a write up of this at some point"
[12:52:59] dysfun: also if you could go ahead and write a blog that doesn't suck, that'd be great
[12:53:31] nickjj: my elixir knowledge is still lackluster but i do have 200+ posts on my site (sucky or not is also debatable!)
[12:53:46] mdbm: what are your blogs guys?
[12:54:52] mdbm: don't be shy..
[12:54:52] dysfun: as i thought was clear, i don't have one
[12:55:17] nickjj: mine isn't very oriented towards elixir yet, it's on all sorts of programming related topics https://nickjanetakis.com/blog/
[12:55:45] mdbm: dysfun, clear for someone who might have read your 1 hour chat:p
[12:56:04] mdbm: nickjj, ok i'm looking (judging)
[12:56:15] dysfun: the last 5 minutes should do it
[12:56:34] nickjj: thumbs up or down, the suspense!
[12:58:17] dysfun: thumbs middle
[12:59:14] dysfun: (not an actual review, i haven't bothered to click)
[12:59:45] nickjj: i was sweating there for a second
[13:00:53] dysfun: would it really matter if some guy on the internet said it wasn't good?
[13:01:00] snapet: has joined #elixir-lang
[13:02:00] nickjj: no, i was being semi-sarcastic, honestly i write most of my posts as personal documentation and publish it in off chance it can help someone else, 0 expectations basically
[13:02:16] dysfun: excellent answer
[13:02:34] mdbm: nickjj, yeah I found two interesting articles for me, most recent are about Docker and I still don't know why I need this lol
[13:02:40] dysfun: i'm only interested in having a blog again so i can link people to these things rather than explain them again
[13:02:57] mdbm: nickjj, i'll read switch linux-> windows, and the 95/5%
[13:06:52] nickjj: dysfun, if you like writing, it's definitely fun, and not too demanding to get up and running with so many static site generators being available
[13:07:33] dysfun: i prefer writing code to prose
[13:08:00] mdbm: if I didn't write what I learned, with all there is to learn, I would forget most, that's why I'm writing on my blog as well, more like personal notes
[13:08:26] dysfun: i've given up on not forgetting what i've learned lol
[13:08:34] dysfun: there just isn't space for me to keep on knowing all the things i've worked with
[13:10:03] either|or: has joined #elixir-lang
[13:10:08] Nicd-: I should write on my blog about something I searched for today
[13:10:08] nickjj: yeah it's scary when you start racking up years of experience but at the same time you can't remember what you had for dinner 4 nights ago
[13:10:15] Nicd-: because it was hard to find
[13:10:38] Nicd-: for the benefit of humanity
[13:10:40] dysfun: you're easily scared heh
[13:10:54] dysfun: ACTION can't remember what he had last night and doesn't much care
[13:11:31] Nicd-: what day was it 4 nights ago?
[13:11:46] dysfun: no trick questions
[13:13:45] Nicd-: sunday apparently. currywurst
[13:14:07] __charly__: has joined #elixir-lang
[13:14:12] dysfun: mmm currywurst
[13:14:21] mdbm: i have to write that on my blog
[13:14:28] nickjj: was it harder than finding out you needed to add "a" after a list of strings using the ~w() syntax when upgrading to phoenix 1.4?
[13:14:55] Nicd-: unsure, I did not have to find that out
[13:14:59] nickjj: because that took like 15min of googling and i think i had like 20 tabs open before i found the answer
[13:15:17] Nicd-: so in my experience that was very very easy as you just told it to me without having to look for it
[13:15:59] OliverMT: nickjj: for what?
[13:16:03] OliverMT: the a means you return a list of atoms
[13:16:28] craigp: has joined #elixir-lang
[13:16:51] nickjj: OliverMT, yes but after upgrading i was getting errors due to not having that, but the error wasn't entirely clear for someone who is still not 100% comfy with elixir yet, the stack trace made it seem like the error was cased by a different part of code
[13:17:04] OliverMT: what is it that requires a list of atoms?
[13:17:48] nickjj: in my case i was using: cast(user, attrs, ~w(email_auth_token)a)
[13:19:43] Nicd-: why that instead of `[:email_auth_token]`?
[13:21:11] nickjj: Nicd-, in that case your way makes sense, i probably had just copied the syntax over from another place that had 4-5 fields instead of 1
[13:21:53] OliverMT: cast has never worked with strings I think?
[13:24:32] Nicd-: that's what they want you to believe
[13:26:13] nickjj: dysfun, you know, after all that, i stumbled on that PDF "what's new in ecto 2.0", have you glanced this at some point?
[13:27:23] nickjj: it has a blurb on creating test data using a pretty similar strategy as you (they don't use faker but that would be easy enough to add in later)
[13:36:34] work_: has joined #elixir-lang
[13:40:11] za1b1tsu: has joined #elixir-lang
[13:44:06] za1b1tsu: so basically I have an email service that sends html emails, I want to use .html.eex. It's not a phoenix project, although I have phoenix as a common dependency in the umbrella. I understand that I could simply use EEx and read the file, but from my google I have found "you'll lose certain performance benefits since the templates won't be known at compile time". Should I try to extract and only use Phoenix.View?
[13:44:19] za1b1tsu: or it's okay to use EEx library only
[13:49:12] benwilson512: za1b1tsu: it's fine to use EEx only. EEx can also operate at compiletime
[13:49:18] benwilson512: whoever said they can't is wrong
[13:50:50] za1b1tsu: nice, benwilson512, thank you
[13:51:29] za1b1tsu: also should I do also EEx.something |> Phoenix.HTML.html_escape()
[13:51:31] za1b1tsu: for safety?
[13:53:03] benwilson512: depends on whether your emails contain user submitted content
[13:53:09] benwilson512: if so, phoenix_html will likely be important
[13:56:45] mdbm: isn't Enum a protocol? I read that protocols extend functionality of modules; I can say that Enum extend the functionality of List, Map, etc.
[13:58:39] benwilson512: mdbm: Enumerable is a protocol. Protocols dynamically dispatch based on datastructure
[14:01:39] proteusguy: has joined #elixir-lang
[14:02:23] mdbm: benwilson512, if I use Enum.at/3 (or any other function actually), I guess code varies whether I operate on a List, Map, ... So I guess that Enum uses functions inside Enumerable that does this dispatch according to datastructure
[14:03:40] benwilson512: mdbm: essentially, yes. the Enum module also has some optimizations for certain fundamental data structures (like lists). Notably, Enum and Stream both make use of the Enumerable protocol. Enum functions operate on Enumerables eagerly, and Stream does so lazily
[14:09:40] gvaughn: has joined #elixir-lang
[14:14:38] ariedler: has joined #elixir-lang
[14:19:07] mdbm: thank you, gtg see you later
[14:21:40] wonko7: has joined #elixir-lang
[14:22:56] duaneb: has joined #elixir-lang
[14:25:46] jsehop9: has joined #elixir-lang
[14:26:19] jsehop9: anyone using salty for libsodium? any better alternatives?
[14:45:05] greengriminal: has joined #elixir-lang
[14:56:37] lexmag: has joined #elixir-lang
[15:05:17] voltone: has joined #elixir-lang
[15:13:24] voltone: has joined #elixir-lang
[15:21:41] wsieroci: has joined #elixir-lang
[15:42:45] lexmag: has joined #elixir-lang
[15:43:34] za1b1tsu: anyone getting really high cpu ussage with elixir-ls? I'm using it with neovim
[15:47:42] icecreamcohen: has joined #elixir-lang
[15:48:07] aalmazan: has joined #elixir-lang
[15:52:31] wonko7: has joined #elixir-lang
[15:57:16] lexmag: has joined #elixir-lang
[15:57:58] tnez: has joined #elixir-lang
[16:00:35] lexmag: has joined #elixir-lang
[16:01:14] lexmag: has joined #elixir-lang
[16:03:48] griffinbyatt: has joined #elixir-lang
[16:10:12] dysfun: za1b1tsu: ime all language servers eat all the cpu, regardless of language :/
[16:27:17] wsieroci: has joined #elixir-lang
[16:29:06] pera: has joined #elixir-lang
[16:37:32] OvermindDL1: For elixir it's mostly because of typing via dialyzer
[16:41:07] drincruz_: has joined #elixir-lang
[16:42:37] nickjj: has anyone successfully used assert_email_delivered_with when testing emails with bamboo's test adapter?
[16:44:30] lpil: Huh, I was going to try elixir-ls but if it's running dialyzer in the background I might have to skip it. :/
[16:45:10] dysfun: that's probably configurable
[16:45:22] dysfun: but if you want type info, what's it supposed to do?
[16:46:52] OvermindDL1: lpil: It is configureable yes, but realtime dialyzer is *way* too nice to not use, and if you have a free core it doesn't matter anyway. :-)
[16:47:11] lpil: Perhaps I'll have to try it
[16:47:29] lpil: I've never had any good experiences with dialyzer but if elixir-ls can change than then I will be happy
[16:48:20] icecreamcohen: i missed the scrollback, but what editor are you two talking about?
[16:49:06] lpil: We're talking about the language server implementation for Elixir that's called elixir-ls
[16:49:31] lpil: It speaks the language server protocol which is can be used from various different editors
[16:49:39] icecreamcohen: righto, I was kind of hoping they’ve made some progress with the emacs integration. Last time I checked, it was not-worky
[16:50:00] icecreamcohen: or not-easily-worky
[16:50:09] lpil: Wow really? I would have expected emacs to have a fantastic LS protocol plugin
[16:50:38] dysfun: there is a good lib for it, not everything uses it
[16:51:00] icecreamcohen: there are a bunch of packages that provide integration
[16:51:07] icecreamcohen: I didn’t try them all out, tbh
[16:51:11] lpil: I've only used LSP with Go and Neovim and I thought it was kinda amazing
[16:51:43] dysfun: i tried it with rust and it turns out it's completely fucking unusable if you're writing procedural macros
[16:52:00] icecreamcohen: i actually thought emacs’s rust-mode was pretty incredible
[16:52:19] dysfun: but the lsp for it is loltastically cpu intensive with proc macros
[16:52:37] icecreamcohen: I didn’t get into macros
[16:52:45] lpil: My Rust code is dumb as mud, I should try it :)
[16:53:13] tristanm_: I've never gotten that damn thing to work with emacs
[16:53:23] icecreamcohen: which damn thing?
[16:53:35] tristanm_: lumpy space princess
[16:53:36] dysfun: it works better if you're using alpha emacs
[16:53:43] tristanm_: I've tried erlang and rust, maybe some others
[16:53:56] lpil: tristan__ Love it. That's the official name from now on in my head-canon
[16:53:57] tristanm_: alpha emacs?
[16:53:57] icecreamcohen: and I feel like the elixir in emacs is bit-rotting
[16:54:09] dysfun: yes, the alpha version of emacs i.e. not stable yet
[16:54:15] tristanm_: I use master
[16:54:25] tristanm_: but hven't updated in a bit, maybe shoudl try again
[16:54:46] icecreamcohen: I have a lot of anxiety over updating emacs… I don’t want my config to break
[16:55:14] tristanm_: my config breaks anyway since I have it auto update packages on startup, hehe
[16:55:49] icecreamcohen: how do you even
[16:56:22] dysfun: sounds awful
[16:56:23] icecreamcohen: tristan__: do you use flycheck by any chance?
[16:56:55] tristanm_: eh, rarely start emacs, only on reboots
[16:57:08] tristanm_: na, for erlang
[16:57:15] icecreamcohen: ACTION weeps
[16:57:23] tristanm_: does it not work with elixir well?
[16:57:43] icecreamcohen: it _did_, but now it gets more and more errors
[16:59:34] icecreamcohen: yeah, it was awesome for a while.
[17:00:51] tristanm_: I've been having to do elixir at work now so should try setting it up
[17:03:23] icecreamcohen: sometimes it works
[17:04:54] icecreamcohen: hmm… maybe I should use flycheck-mix rather than flycheck-elixir
[17:05:54] tristanm_: oh. yea, I use flycheck for rebar3 and not erlang
[17:06:19] icecreamcohen: that seems to work better
[17:09:15] icecreamcohen: well, thanks, tristan__
[17:10:10] jnoon2: has joined #elixir-lang
[17:17:46] icecreamcohen: has joined #elixir-lang
[17:20:22] lexmag: has joined #elixir-lang
[17:21:13] za1b1tsu: has joined #elixir-lang
[17:25:43] pera: has joined #elixir-lang
[17:31:36] nickjj: would you guys say it's a best practice to put a count function in your project's repo.ex module so you can do things like Repo.count(User)? or would you rather expose a count_users functions in a context? or do both?
[17:38:54] dysfun: er, to what, count the number of entries in the table?
[17:46:50] jmcgnh_: has joined #elixir-lang
[17:47:30] nickjj: yep, for a specific resource
[17:50:54] nickjj: this is what i'm doing now but it feels a little boilerplate'y, but if one purpose of a context is to abstract away the Repo so it's not directly callable in your controllers/tests then i guess this is the way to do it? https://gist.github.com/nickjj/a439eac604ba76666ecaa5e026cf5ac6
[17:52:44] Saukk: has joined #elixir-lang
[18:06:11] Randyr: has joined #elixir-lang
[18:16:24] greengriminal: has joined #elixir-lang
[18:23:57] sacredfrog: has joined #elixir-lang
[18:27:16] greengriminal: has joined #elixir-lang
[18:31:12] drincruz_: has joined #elixir-lang
[18:32:57] sacredfrog: has joined #elixir-lang
[18:47:21] sacredfrog: has joined #elixir-lang
[18:49:00] Phylock: has joined #elixir-lang
[18:49:52] sacredfrog: has joined #elixir-lang
[18:50:04] m1dnight_: has joined #elixir-lang
[18:55:03] hypercore: has joined #elixir-lang
[18:58:38] lexmag: has joined #elixir-lang
[19:09:08] antranigv: hi friends! any distillery gurus around here?
[19:09:19] Nicd-: don't ask to ask ;)
[19:09:29] Nicd-: nice to see you here antranigv
[19:09:41] antranigv: Nicd-: always :D haven't slept in days. forgot to NOT do that.
[19:09:56] antranigv: Nicd-: nice to see you too! btw, are the issues fixed about CS?
[19:10:46] Nicd-: well it works fine as long as I don't restart it :D
[19:11:13] Nicd-: if I do, it is hammered with requests and takes a while to normalise
[19:11:22] DeadTrickster_: has joined #elixir-lang
[19:11:41] jegaxd26: has joined #elixir-lang
[19:11:49] Nicd-: still planning to move to SSD server but I don't have too much time
[19:11:58] antranigv: so, guys, here's what I'm able to do. I can do bin/myapp console_clean, then run my command "Mix.Tasks.IlSched.Create.run["somedata"]", but I want to automate that process using custom commands in distillery.
[19:12:11] antranigv: Nicd-: IO issue? damn
[19:12:21] Nicd-: yes the HDD is slow
[19:12:43] mahmudov: has joined #elixir-lang
[19:15:33] antranigv: it's actually mnesia stuff, so it says that the node is not accessible, but isn't distillery supposed to start the node?
[19:16:45] Nicd-: do you want to run it in the running release?
[19:19:36] Nicd-: the "Mix tasks" section here along with the last warning explains how to do it: https://hexdocs.pm/distillery/extensibility/custom_commands.html
[19:19:48] Nicd-: it doesn't need to be a mix task though
[19:23:50] za1b1tsu: has joined #elixir-lang
[19:24:35] squall: has joined #elixir-lang
[19:28:25] lexmag: has joined #elixir-lang
[19:34:18] jegaxd26: has joined #elixir-lang
[19:39:13] icecreamcohen: has joined #elixir-lang
[19:42:02] za1b1tsu: is there a way to get the key value of struct dynamcially?
[19:43:14] Nicd-: Which key?
[19:43:31] Nicd-: Map.get or pattern matching
[19:45:07] icecreamcohen: has joined #elixir-lang
[19:46:48] jmcgnh: has joined #elixir-lang
[19:47:32] lexmag: has joined #elixir-lang
[19:56:46] lexmag: has joined #elixir-lang
[20:00:56] uplime: would someone mind giving me a hint what I'm doing wrong here? https://clbin.com/wfNRW
[20:01:14] za1b1tsu: wow, how come Map.get works on Structs
[20:01:29] lpil: za1b1tsu Structs are just maps with known keys :)
[20:02:23] lexmag: has joined #elixir-lang
[20:03:44] OvermindDL1: Yep, a struct in most languages would lower to a tuple, but in elixir it lowers to a map, which gives it a different algorithmic speed but perfectly sufficient for 99.99% of uses, and it makes working with them like maps far more simple. ^.^
[20:04:16] OvermindDL1: Technically a struct is just a map with a `__struct__: SomeModule` key and the rest of the keys in it match the SomeModule's specification of it
[20:04:59] uplime: ah, had to pass a char list
[20:07:59] lexmag: has joined #elixir-lang
[20:16:47] ariedler: has joined #elixir-lang
[20:20:18] lexmag: has joined #elixir-lang
[20:31:53] lexmag: has joined #elixir-lang
[20:51:14] laut: has joined #elixir-lang
[21:00:30] jeffro_: has joined #elixir-lang
[21:03:21] jhill: has joined #elixir-lang
[21:13:17] ur5us: has joined #elixir-lang
[21:24:17] netrino: has joined #elixir-lang
[21:43:01] __charly__: has joined #elixir-lang
[21:43:06] netrino_: has joined #elixir-lang
[21:47:48] DTZUZO: has joined #elixir-lang
[21:48:12] netrino: has joined #elixir-lang
[21:48:37] pera: has joined #elixir-lang
[21:53:18] icecreamcohen: has joined #elixir-lang
[21:53:30] jmcgnh: has joined #elixir-lang
[22:17:25] ur5us_: has joined #elixir-lang
[22:18:06] ariedler: has joined #elixir-lang
[22:19:57] drincruz_: has joined #elixir-lang
[22:24:32] ariedler: has joined #elixir-lang
[22:28:53] nickjj: am i going down a bad path by having a factory.ex file for tests to build structs for various resources (users, etc.) but then using @create_attrs Map.from_struct(build(:user)) so i can use variations in my tests?
[22:29:28] nickjj: i also went as far as creating an invalid function in the factory file which returns just the map , so i can do things like @invalid_attrs invalid(:user) , not really sure how to improve this type of set up
[22:35:55] ahills: has joined #elixir-lang
[22:36:26] uranoss: has joined #elixir-lang
[22:36:26] dnyy: has joined #elixir-lang
[22:36:26] DukeDave: has joined #elixir-lang
[22:36:33] b-m-f: has joined #elixir-lang
[22:42:08] jmcgnh: has joined #elixir-lang
[22:58:17] craigp: has joined #elixir-lang
[23:04:54] ariedler: has joined #elixir-lang
[23:18:24] lucus16: has left #elixir-lang: ("-")
[23:28:28] gvaughn: has joined #elixir-lang
[23:34:58] kyrylo: has joined #elixir-lang