This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
class JsonMiddleware | |
{ | |
public function handle(Request $request, Closure $next) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GIT | |
# -------------------------------------------- | |
alias ga="git add" | |
alias gaa="git add ." | |
alias gc="git commit -m " | |
alias gp="git push github" | |
alias gs="git status" | |
alias nah="git reset --hard; git clean -df;" | |
# -------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Http\Controllers\Auth; | |
use Auth; | |
use App\Http\Controllers\Controller; | |
use Illuminate\Contracts\Auth\Registrar; | |
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; | |
class AuthController extends Controller { | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
No jQuery necessary. | |
Thanks to Dan's StackOverflow answer for this: | |
http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport | |
*/ | |
function isElementInViewport(el) { | |
var rect = el.getBoundingClientRect(); | |
return ( | |
rect.top >= 0 && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function inferInputModel() { | |
if (window.navigator.msPointerEnabled) { | |
return 'pointer'; | |
} else if (window.ontouchstart !== undefined) { | |
return 'touch'; | |
} else { | |
return 'unknown'; | |
} | |
} |