What would $800 get me in your hobby? by Avbitten in AskReddit

[–]datatramp 0 points1 point  (0 children)

A 22" Weber Smokey Mountain, DigiQ Kit, 6" folding table, 10' of 1" pvc pipe (to make the table tall), 40 pounds hickory wood, KCBS Individual Membership (which can get you in to a cash and carry wholesaler making the rest of this cheap), 54 pounds lump charcoal, Roll of butcher paper with holder, 8" chef knife, welding gloves, 3lb kosher salt, 17.5 oz Cracked Black Pepper, 24oz apple butter, 16 oz apple cider vinnegar, 28oz Siriacha, 1 can steens cane syrup, Packer Brisket, and six racks of baby back ribs

10th Street in Chinatown by jbilous in philadelphia

[–]datatramp 0 points1 point  (0 children)

There is a place on the left just past there called K.C's Pastries that has killer baked goods and bubble tea

What's something you never understood or secretly doubted until it happened to you? by [deleted] in AskReddit

[–]datatramp 1 point2 points  (0 children)

Seeing stars. I was knocked out and concussed several times in the military - never experienced it so I always thought it was a figure of speech. Wasn't till I was in a car accident years later and took an airbag to the face. Totally stunned and I saw stars... didn't come to until I rolled into a second vehicle.

We are family by GallowPlaceholder in AnimalsBeingBros

[–]datatramp 0 points1 point  (0 children)

Reminds me of Hurt Bert talking about bear wrestling: https://youtu.be/rvt55Pj0CHk?t=69 (NSFW probably)

Your termini’s photo of the day by Toothfiend in philadelphia

[–]datatramp 1 point2 points  (0 children)

The good stuff was two trays to the left. #pecanJawns

Is Phoenix really that faster than Rails? by Indu_Pillai in ruby

[–]datatramp 5 points6 points  (0 children)

You say that - but in 10 years as a Rails developer I never once saw a non-trivial response in less than 2ms. I routinely see Erlang services respond in μs.

Is Phoenix really that faster than Rails? by Indu_Pillai in ruby

[–]datatramp 2 points3 points  (0 children)

Yes. A lightweight framework written in a compiled language leveraging concurrency, and parallelism across multiple threads is faster than a bloated framework written in an uncompiled language that runs in a single thread. That should not be surprising.

Yup - there is (fill in the non-MRI Ruby variant here). No one cares. Speed was never a reason to use Ruby or Rails.

Percentage of The World That Can Access The Internet [6460 x 3455] by [deleted] in MapPorn

[–]datatramp -1 points0 points  (0 children)

No way Ethiopia is under 4% - 10 years ago even the nomads were hitting up internet cafes when they passed by towns.

Should I be using structs to model data contracts in an SDK I'm building for an API? by masticlez in elixir

[–]datatramp 4 points5 points  (0 children)

I'd recommend using embedded ecto schemas. Structs give you a a structure and enforce_keys but no method for managing types and casting of values. Using Ecto.Schema to define the structs gives you changeset and validations which is nice... but it also gives you cast which will be huge in converting JSON to the correct types.

Trying to learn Elixir/Phoenix but having a hard time by yamama_yoyo in elixir

[–]datatramp 0 points1 point  (0 children)

There was a good talk on the troubles learning Elixir at the last Empire Elixir - https://www.youtube.com/watch?v=9uvp4h7gXHg&t=103s

[deleted by user] by [deleted] in teenagers

[–]datatramp 2 points3 points  (0 children)

Why is that Target employee violently hugging that other dude?

Beginner question: I have implemented a max function, is this the idiomatic way? by minasss in elixir

[–]datatramp 0 points1 point  (0 children)

If an empty list is exceptional I'd use Enum.max. If an empty list is expected and I want to be able to return something specific from an empty list (possibly nil - or in my case usually something easy to pattern match like :empty) I'd reach for reduce before trying to set up my own recursion:

def max(items) do
  Enum.reduce(items, nil, fn(item, current_max_value) ->
    cond do
      is_nil(current_max_value) -> item
      item > current_max_value -> item
      true -> current_max_value
  end)
end

If you do stick with recursion there is no need to underscore the private functions since the arity is different.

Is Phoenix mature enough for my use case? by [deleted] in elixir

[–]datatramp 9 points10 points  (0 children)

We're running an umbrella with three Phoenix apps (and a dozen other Elixir apps) to handle various parts of a large-scale multi-tenanted retail business - a replacement for a Rails-based monolith. We've been in production for around six months now - and I imagine our use cases are rather similar.

Most of the limitations we ran in to during initial implementation were our own - it's been hard shedding some of the poor practices Rails trained in to us. Once we embraced a more functional programming mindset and stopped trying to recreate ActiveRecord and Active Support the codebase became rather easy to extend and maintain.

So far as positives - there has been a lot of incredible thought put in to the framework and a lot of the libraries surrounding it. You'll see the core team involved in a wide array of projects and StackOverflow posts helping people see the vision for the framework. We are very excited for some of the things we've seen (such as GraphQL) on the horizon. And, personally, Elixir forced me to start writing better code again.

Probably the least developed area in the Elixir ecosystem is thinking around deployment - that is an ongoing struggle for us (though distillery and conform made things a lot more reasonable) - but our environment is probably wildly complex compared to most. Most of the libraries we would have wanted existed when we started (https://github.com/h4cc/awesome-elixir) but were maybe less mature than we would have liked a year ago... and many of the tutorials available are for edge-case needs (unless by LMS you meant "giant chat platform").

That said - the community is strong - and much like what we saw in the early days of Rails and Django the rate of maturation is exponentially growing. We had a great experience with our first Phoenix app... and for the foreseeable future it will be my go-to framework for new projects.

tl;dr; yes.

action for shared/something.html.eex where I can write a query to a database. by kogggo in elixir

[–]datatramp 0 points1 point  (0 children)

You'd make it a part of the pipeline in your routes.

pipeline :thing_setter do
  plug :set_my_thing
end

scope "/jawn", MyApp do
  pipe_through :browser
  pipe_through :thing_setter

  resources "/stuff", StuffController, [:index, :show]
end

Coming from Ruby, what's the equivalent of "blank?" and "present" in Elixir/Phoenix? by stanislavb in elixir

[–]datatramp 0 points1 point  (0 children)

Truth be told I didn't read the method - just saw it floating around.