Skip to content

Instantly share code, notes, and snippets.

View rvcas's full-sized avatar
👾
stuff

Lucas rvcas

👾
stuff
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lrosa007 on github.
  • I am lrosa007 (https://keybase.io/lrosa007) on keybase.
  • I have a public key ASD8ETOT11FkkNGhHRhHGktGepuTgW1CiXfLhZJ1QjjX2go

To claim this, I am signing this object:

const apiUrl = 'http://localhost:5000/api';
class Overview extends Component {
constructor(props) {
super(props);
// it's nice to do it here because then
// you can init some state with passed props if needed
this.state = {
users: {},
@rvcas
rvcas / count.exs
Last active August 4, 2017 11:36
Concurrently counts how many files reference a certain word at least once in the sub folders of the Rails app folder
#!/usr/local/bin/elixir
import IO.ANSI, only: [yellow: 0, light_magenta: 0, light_cyan: 0]
defmodule Counter do
use GenServer
@cmd "rg"
def start do
GenServer.start(__MODULE__, [])
@rvcas
rvcas / perhaps.elm
Last active May 3, 2017 16:04
Some nonsense in Elm
module Main exposing (..)
import Html
type Maybe a
= Just a
| Nothing
@rvcas
rvcas / MyList.ex
Created February 2, 2017 04:31
Reversing a list cause I felt like it
defmodule MyList do
def reverse([]), do: []
def reverse([h | t]), do: do_reverse(t, [h])
defp do_reverse([], acc), do: acc
defp do_reverse([h | t], acc), do: do_reverse(t, [h | acc])
end
@rvcas
rvcas / fizzbuzz.ex
Created August 7, 2016 19:01
Classic Fizz Buzz with Pattern Matching
defmodule FizzBuzz do
def fizzer(n), do: buzzer(rem(n, 3), rem(n, 5), n)
defp buzzer(0, 0, _), do: "Fizz Buzz"
defp buzzer(0, _, _), do: "Fizz"
defp buzzer(_, 0, _), do: "Buzz"
defp buzzer(_, _, n), do: n
end