This file contains hidden or 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\Providers; | |
| use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; | |
| use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; | |
| class EventServiceProvider extends ServiceProvider | |
| { | |
| /** |
This file contains hidden or 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
| @extends('layouts.error') | |
| @section('code') | |
| 403 | |
| @endsection | |
| @section('shortmessage') | |
| Forbidden… | |
| @endsection | |
| @section('longmessage') | |
| If authentication credentials were provided in the request, the server <br> |
This file contains hidden or 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 | |
| class TestCase extends Illuminate\Foundation\Testing\TestCase | |
| { | |
| /** | |
| * Tracks whether we must (re)seed | |
| * @var bool | |
| */ | |
| protected static $needsSeed = true; | |
This file contains hidden or 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
| $app->configureMonologUsing(function($monolog) use ($app) { | |
| // log more severe messages to loggly | |
| $config = $app->make('config'); | |
| $logglyToken = $config->get('app.loggly_token'); | |
| $tag = $config->get('app.base_domain'); |
This file contains hidden or 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
| $(".checkbox-all > input").change(function() { | |
| $(':checkbox').prop('checked', this.checked); | |
| }); | |
| $("form > input").change(function() { | |
| if (this.checked == false) { | |
| $(".checkbox-all > input").prop("checked", false); | |
| } | |
| }) |
This file contains hidden or 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
| # redirects http traffic to https | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name mysite.co.uk www.mysite.co.uk; | |
| return 301 https://$server_name$request_uri; | |
| } | |
| # redirect non-www to www |
This file contains hidden or 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
| # Read | |
| # http://wiki.nginx.org/Pitfalls | |
| # http://wiki.nginx.org/QuickStart# | |
| # http://tautt.com/best-nginx-configuration-for-security/ | |
| # | |
| # Generate your key with: openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 | |
| # Generate certificate: sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt | |
| ## redirects http traffic to https ## | |
| server { |
This file contains hidden or 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
| // laravel 5.1 kernel (http and console) to bootstrap using the custom ConfigureLogging class | |
| public function __construct(Application $app, Router $router) | |
| { | |
| parent::__construct($app, $router); | |
| array_walk($this->bootstrappers, function(&$bootstrapper) | |
| { | |
| if($bootstrapper === 'Illuminate\Foundation\Bootstrap\ConfigureLogging') | |
| { |
This file contains hidden or 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
| fizz = fn | |
| {0, 0, _} -> "FizzBuzz" | |
| {0, _, _} -> "Fizz" | |
| {_, 0, _} -> "Buzz" | |
| {_, _, a} -> "#{a}" | |
| end | |
| foo = fn (n) -> "#{IO.puts(fizz.({rem(n,3), rem(n,5), n}))}" end | |
| for i <- 1..100 do |
This file contains hidden or 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
| # Fail2Ban configuration file | |
| # | |
| # Regexp to catch known spambots and software alike. Please verify | |
| # that it is your intent to block IPs which were driven by | |
| # above mentioned bots. | |
| [Definition] | |
| badbotscustom = EmailCollector|WebEMailExtrac|TrackBack/1\.02|sogou music spider|Baiduspider |