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
package structs | |
import "reflect" | |
// obj1 := struct{ ID string Name string } | |
// obj2 := struct{ ID string Name string }{ ID: "1", Name: "Jhon" } | |
// | |
// merged := merge.Structs(obj1, obj2) | |
// | |
// merge => struct{ ID string Name string }{ ID: "1", Name: "Jhon" } |
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 AppCacheServiceProvider extends ServiceProvider { | |
public function register() | |
{ | |
$this->app->extend('cache', function($original, $app) { | |
return new AppCacheManager($app); | |
}); | |
} |
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 | |
use Gousto\Replay\Replay; | |
use Gousto\Replay\RetryLogicException; | |
class AppCacheManager extends CacheManager { | |
public function store($name = null) | |
{ | |
try { |
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
/** | |
* Get includes that are valid relations | |
* on models, it can go deep as much as we need | |
* it will also cut off the not existing relations | |
* | |
* @param array $relations | |
* @return array|bool | |
*/ | |
public function validateRelations(array $relations = []) | |
{ |
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
{ | |
module: { | |
loaders: [{ | |
test: /\.(js|jsx)$/, | |
loader: 'happypack/loader?id=loader0', | |
exclude: [/\/node_modules\//] | |
}, | |
{ | |
test: /\.css$/, | |
exclude: [/\/node_modules\//], |
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
const { group } = require('@webpack-blocks/core') | |
const HappyPack = require('happypack'); | |
module.exports = happypack | |
function happypack (blocks) { | |
return group(blocks.map(happyfyBlock)) | |
} | |
/** |
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
const HappyPack = require('happypack') | |
module.exports = happyPack | |
function happyPack (blocks = [], options = {}) { | |
const happyThreadPool = HappyPack.ThreadPool({ size: options.size || 5 }) | |
return (context, webpackConfig) => { |
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
// GraphQL query that i'm trying to resolve with Dataloader but i can't find a way to pass argument to the | |
// loader function. | |
// The following GraphQL query should invoke the following DB round trips | |
// 1 - Posts * | |
// 2 - Tags limit 10 where post_id = ? | |
// 3 - Tags limit 20 where post_id = ? | |
query limitTagsOfThePost { | |
posts { | |
name | |
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 | |
interface FilterableInterface { | |
} |
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 Core\Cache; | |
/** | |
* Class CacheMeRemainder | |
* | |
* @package Core\Cache | |
*/ | |
class CacheMeRemainder { | |
/** |