Skip to content

Instantly share code, notes, and snippets.

Rodrigo Nonose rhnonose

Block or report user

Report or block rhnonose

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View absinthe_collector.ex
defmodule AbsintheCollector do
@moduledoc """
Module to collect absinthe telemetry events
"""
use Prometheus.Metric
require Prometheus.Contrib.HTTP
@events [
[:absinthe, :resolve, :field, :start],
[:absinthe, :resolve, :field],
@rhnonose
rhnonose / cla.md
Created Oct 23, 2018 — forked from kitten/cla.md
MIT CLA
View cla.md

Individual Contributor License Agreement (CLA)

Thank you for submitting your contributions to this project.

By signing this CLA, you agree that the following terms apply to all of your past, present and future contributions to the project.

License.

You hereby represent that all present, past and future contributions are governed by the

@rhnonose
rhnonose / Map.Helpers
Last active Jan 2, 2018 — forked from kipcole9/Map.Helpers
Helpers for Elixir Maps: underscore, atomise and stringify map keys
View Map.Helpers
defmodule Map.Helpers do
@moduledoc """
Functions to transform maps
"""
@doc """
Convert map string camelCase keys to underscore_keys
"""
def underscore_keys(nil), do: nil
@rhnonose
rhnonose / assignment.erl
Created Mar 6, 2017
FutureLearn functional programming erlang assignment 1
View assignment.erl
-module(assignment).
-export([area/1, perimeter/1, enclose/1, bits/1, bits_tail/1]).
area({A,B,C}) ->
S = (A+B+C)/2,
math:sqrt(S*(S-A)*(S-B)*(S-C));
area({A,B}) ->
A*B.
@rhnonose
rhnonose / first.erl
Last active Feb 22, 2017
FutureLearn exercises
View first.erl
-module(first).
-export([double/1, mult/2, area/3, square/1, treble/1]).
mult(X,Y) ->
X*Y.
double(X) ->
mult(X, 2).
area(A,B,C) ->
View keybase.md

Keybase proof

I hereby claim:

  • I am rhnonose on github.
  • I am rhnonose (https://keybase.io/rhnonose) on keybase.
  • I have a public key whose fingerprint is 79C4 774C 5684 8922 236E 4EFF 00D8 CD34 34AF B2E1

To claim this, I am signing this object:

@rhnonose
rhnonose / my_list.ex
Created Apr 27, 2016
List.flatten reimplementation in elixir.
View my_list.ex
defmodule MyList do
def flatten(array) do
reduce_flatten(array, [])
end
def reduce_flatten([], acc), do: acc
def reduce_flatten([elem | rest], acc) do
Enum.reduce([elem | rest], acc, &reduce_flatten/2)
You can’t perform that action at this time.