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 | |
/** | |
* Transforms an under_scored_string to a camelCasedOne | |
*/ | |
function camelize($scored) { | |
return lcfirst( | |
implode( | |
'', | |
array_map( |
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 CQRSSample\Domain\Model | |
{ | |
/** | |
* Please read this. It may be interesting to you. You can ridicule me ONLY if you read the whole thing. | |
* | |
* CQRS is NOT about different data sources and is NOT about Event Sourcing. | |
* CQRS IS about breaking out your reads and writes. It's powerful and simple! |
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 | |
declare(strict_types=1); | |
namespace App\Validator\Constraints; | |
use Symfony\Component\Validator\Constraints\Composite; | |
/** | |
* @Annotation() |
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
img.grayscale.disabled { | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); | |
-webkit-filter: grayscale(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
<?php namespace App\Http\Middleware; | |
use Carbon\Carbon; | |
use Closure; | |
use Illuminate\Cache\Repository as Cache; | |
use Illuminate\Support\Facades\Response; | |
use Illuminate\Support\Facades\Session; | |
class PreventReplayAttack | |
{ |
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\Request\ParamConverter; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; | |
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Validator\ConstraintViolationListInterface; | |
final class ConstraintViolationsConverter implements ParamConverterInterface |
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
import axios from 'axios' | |
import toast from './toast' | |
function errorResponseHandler(error) { | |
// check for errorHandle config | |
if( error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false ) { | |
return Promise.reject(error); | |
} | |
// if has response show the error |
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
// Aspect interface for combinator | |
interface Aspect { | |
operator fun <R> invoke(block: () -> R): R | |
} | |
// Aspect combinator | |
operator fun Aspect.plus(other: Aspect) = object : Aspect { | |
override fun <R> invoke(block: () -> R): R = | |
this@plus { | |
other { |
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() { | |
/* Define a variável que dá swipe no lightbox */ | |
var magnificPopup = $.magnificPopup.instance; | |
/* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */ | |
$("a.image-lightbox").click(function(e) { | |
/* Espera carregar o lightbox */ | |
setTimeout(function() { | |
/* Swipe para a esquerda - Próximo */ |
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 | |
class BaseModel extends Eloquent { | |
public static function isJoined($query, $table) | |
{ | |
$joins = $query->getQuery()->joins; | |
if($joins == null) { | |
return false; | |
} |