Skip to content

Instantly share code, notes, and snippets.

View jonatanklosko's full-sized avatar
🍵
Turning tea into code

Jonatan Kłosko jonatanklosko

🍵
Turning tea into code
View GitHub Profile

Using :httpc securely

Introduction

There are many HTTP clients in the Erlang and Elixir ecosystem, in fact OTP itself comes with one included - :httpc.

This raises the question which client to use and whether :httpc is good enough if all you need is a simple request here and there. This notebook explores relevant security concerns and highlights how to address them when using :httpc.

@jonatanklosko
jonatanklosko / all_zeros_at_end.rb
Created November 1, 2016 01:23
Check if all the zeros of an array are at the end
def all_zeros_at_end(array)
array.drop_while(&:nonzero?).all?(&:zero?)
end
@jonatanklosko
jonatanklosko / application.html.erb
Last active February 4, 2017 16:16
Rails 4 and JavaScript assets
<!-- app/views/layouts/application.html.erb -->
<!-- ... -->
<body class="<%= controller_name %> <%= action_name %>">
<!-- ... -->
</body>
<!-- ... -->