Skip to content

Instantly share code, notes, and snippets.

View mercuryseries's full-sized avatar

Honoré Hounwanou mercuryseries

View GitHub Profile
@mercuryseries
mercuryseries / .vimrc
Last active January 8, 2016 15:06
My .vimrc config gile
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'bling/vim-airline'
Plugin 'airblade/vim-gitgutter'
Plugin 'ctrlpvim/ctrlp.vim'
@mercuryseries
mercuryseries / ViewAssertionsUtils.php
Created August 7, 2016 03:42
Some View Assertions Utils for the Laravel Framework
<?php
trait ViewAssertionsUtils
{
/**
* Tests to see whether the view template provided is the one
* used in the rendered view.
*
* @param string
* @return \Illuminate\Foundation\Testing\TestCase
@mercuryseries
mercuryseries / MakeHttpRequests.php
Created August 7, 2016 03:43
Some test method helpers for the Laravel Framework
<?php
trait MakeHttpRequests
{
/**
* Visit the given route with a GET request.
*
* @param string $uri
* @param array $headers
* @return $this
@mercuryseries
mercuryseries / InteractsWithPages.php
Created August 7, 2016 03:43
Some test method helpers for the Laravel Framework
<?php
trait InteractsWithPages
{
/**
* Assert that the current route matches the given one.
*
* @param string $route_name
* @return $this
*/
jQuery(function () {
var larails = {
// Define the name of the hidden input field for method submission
methodInputName: '_method',
// Define the name of the hidden input field for token submission
tokenInputName: '_token',
// Define the name of the meta tag from where we can get the csrf-token
metaNameToken: 'csrf-token',
@mercuryseries
mercuryseries / HasSecurePassword.php
Created September 26, 2016 06:45
Laravel Basic Authentication Trait
<?php
namespace App\Traits;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
trait HasSecurePassword
{
/**
@mercuryseries
mercuryseries / User.php
Created September 26, 2016 06:46
Basic Authentication User Model [Example]
<?php
namespace App;
use App\Traits\HasSecurePassword;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
use HasSecurePassword;
@mercuryseries
mercuryseries / routes.php
Created September 26, 2016 06:47
Basic Authentication Logic/Routes [Example]
<?php
use App\User;
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
@mercuryseries
mercuryseries / login_register.blade.php
Created September 26, 2016 06:51
Basic Authentication Laravel Register/Login Views [Example]
<!-- Login View -->
<form action="/login" method="POST">
{{ csrf_field() }}
<input type="email" name="email" placeholder="email"><br>
<input type="password" name="password" placeholder="password"><br>
<input type="submit">
</form>
<!-- End Login View -->
<!-- Register View -->
@mercuryseries
mercuryseries / create_users_table.php
Created September 26, 2016 06:54
Basic Authentication Laravel Users Table Migration [Example]
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.