Skip to content

Instantly share code, notes, and snippets.

View m4grio's full-sized avatar
ded

Mario Álvarez m4grio

ded
View GitHub Profile
@m4grio
m4grio / number.erl
Last active February 27, 2017 08:56
PHP vs Erlang
-module(number).
-export([
is_perfect/1
]).
is_perfect(N, N, S) -> N==S;
is_perfect(N, M, S) when N rem M == 0 -> is_perfect(N, M+1, S+M);
is_perfect(N, M, S) -> is_perfect(N, M+1, S).
is_perfect(N) -> is_perfect(N, 1, 0).

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@m4grio
m4grio / Blueprint.php
Last active June 14, 2019 06:45
Extending Laravel 5 Blueprint for MySqlConnection
<?php
namespace App\Database\Schema;
use Illuminate\Database\Schema\Blueprint as ParentBlueprint;
use Illuminate\Support\Facades\DB;
/**
* Class Blueprint
*