Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jeremie Ges GesJeremie

🏠
Working from home
View GitHub Profile
View method.ex
def create_contact(conn, %{"classified_contact" => params, "id" => id}) do
with {:ok, conn} <- CreateContactOperation.run(conn, params, %{classified_id: id}) do
conn
|> redirect(to: app_classified_path(conn, :show, id))
else
{:error, conn} ->
conn
|> show(%{"id" => id})
end
View operation.ex
defmodule Babysitting.Operations.Classified.CreateContactOperation do
import Plug.Conn;
alias Babysitting.Repo;
alias Babysitting.{ClassifiedContact}
alias Babysitting.Changesets.{ClassifiedContactChangeset}
def run(conn, params, options) do
conn = assign(conn, :params, params)
conn = assign(conn, :options, options)
View keybase.md

Keybase proof

I hereby claim:

  • I am GesJeremie on github.
  • I am gesjeremie (https://keybase.io/gesjeremie) on keybase.
  • I have a public key whose fingerprint is 62AC 3C92 E55E 184B 6815 33EF 174E D6C5 6732 B3F1

To claim this, I am signing this object:

View list-countries-elixir.ex
countries = [
%{code: "AF", name: "Afghanistan"},
%{code: "AX", name: "Åland Islands"},
%{code: "AL", name: "Albania"},
%{code: "DZ", name: "Algeria"},
%{code: "AS", name: "American Samoa"},
%{code: "AD", name: "Andorra"},
%{code: "AO", name: "Angola"},
%{code: "AI", name: "Anguilla"},
%{code: "AQ", name: "Antarctica"},
View gist:f107c305beccb3e8b5e8
`!slack` - *Lien intégrations slack*,
`!bib admin` - Lien panel d'administration BIB,
`!finances [year]` - Lien suivi des finances,
@GesJeremie
GesJeremie / PurchaseMasterBoxTest.php
Created Jan 21, 2016
Put that under tests/functionnal/PurchaseMasterBoxTest.php
View PurchaseMasterBoxTest.php
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Faker\Factory as Faker;
class PurchaseMasterBoxTest extends TestCase
{
View migration1.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserOrderBuildingsTable extends Migration {
/**
* Run the migrations.
*
@GesJeremie
GesJeremie / EmailExampleTest.php
Created Nov 23, 2015
Email test case for testing emails with Mailtrap.io in Phpunit
View EmailExampleTest.php
<?php
/*
|--------------------------------------------------------------------------
| EmailExampleTest
|--------------------------------------------------------------------------
|
| Email test case for testing emails with Mailtrap.io in Phpunit
|
| Requirements:
| - Laravel 5.1
@GesJeremie
GesJeremie / deploy.php
Last active Apr 11, 2017
Laravel 5 example deployer
View deploy.php
<?php
/**
* Require dependency
*/
require_once 'recipe/common.php';
/**
* How many releases we want to keep
*/