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
package com.security.test.config; | |
import lombok.RequiredArgsConstructor; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.security.config.Customizer; | |
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer; | |
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; |
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
location /files { | |
rewrite ^/files/?(.*)$ /files/load_file.php?file=$1 last; | |
} |
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\Support\Facades\Blade; | |
use Illuminate\Support\ServiceProvider; | |
class BladeServiceProvider 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
<?php | |
if ( ! isset($array['q']) || ! isset($array['w']) || ! isset($array['e'])) { | |
// PANIC | |
} | |
# Becomes | |
if ( ! isset($array['q'], $array['w'], $array['e'])) { | |
// OH NO! |
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
{ | |
"size" : 0, | |
"aggs": { | |
"group" : { | |
"terms" : { | |
"field" : "category_id" | |
}, | |
"aggs" : { | |
"group_docs" : { | |
"top_hits" : { |
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
alias art="php artisan" | |
alias c='composer' | |
alias cclear='php artisan cache:clear' | |
alias cdo="composer dump-autoload -o" | |
alias cu='composer update' | |
alias ci='composer install' | |
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome" | |
alias d='docker' | |
alias d='php artisan db:seed' | |
alias doc='docker-compose' |
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
#!/usr/bin/env bash | |
function pw { | |
# Register the command you want to run when changes are detected here | |
run="clear && printf '\e[3J' && vendor/bin/phpunit" | |
# Retrieve the custom argments. If none are provided, default to "tests" | |
[[ -n $@ ]] && args=$@ || args="tests" | |
# Run the command first... |
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 | |
function increment($matches) { | |
return ++$matches[1]; | |
} | |
$string = 'value1'; | |
$string = preg_replace_callback( "|(\d+)|", 'increment', $string); | |
echo $string; // value2 |
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\Services; | |
use App\Post; | |
class Slug | |
{ | |
/** | |
* @param $title |