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
#!/bin/bash | |
# Traceparent Generator and Jaeger Trace Sender | |
# | |
# This script generates a W3C traceparent header, allows time to copy it, | |
# and then sends a corresponding trace span to Jaeger via OpenTelemetry HTTP protocol. | |
# | |
# Requirements: curl (usually pre-installed on macOS/Linux) | |
# | |
# Usage: |
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\Support; | |
use Generator; | |
class ChunkCsvReader | |
{ | |
protected array|false $header; |
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\Support; | |
use Illuminate\Session\Store; | |
use RuntimeException; | |
/** | |
* Helper class that transforms all sessions into a specific key. | |
* |
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 Tests\Support; | |
use ReflectionClass; | |
use ReflectionException; | |
use ReflectionObject; | |
class PrivateAccess | |
{ |
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\Support; | |
use Closure; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Str; | |
class Database | |
{ |
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
export default class Str { | |
static slug(value, sep) { | |
var separator = sep || '-'; | |
value = Str.ascii(value); | |
var flip = separator == '-' ? '_' : '-'; | |
value = value.replace(new RegExp(Str.pregQuote(flip), 'g'), separator); |
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 | |
use Illuminate\Http\Request; | |
use Illuminate\Routing\Route; | |
use Illuminate\Support\Facades\Route as Router; | |
class RequestBuilder | |
{ | |
/** | |
* Will create a request with the correct fullUrl, route parameters and input parameters. |
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\Database\Eloquent\Builder; | |
use Illuminate\Database\Eloquent\ModelNotFoundException; | |
use Illuminate\Support\ServiceProvider; | |
class SafeQueryServiceProvider 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 | |
namespace App\Rules; | |
use Illuminate\Support\Facades\Validator; | |
use Illuminate\Contracts\Validation\Rule; | |
class BaseRule | |
{ | |
protected $validator = null; |
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
import joi from 'joi' | |
import validate from 'express-validation' | |
import middleware from 'middleware' | |
import AuthService from 'auth.service' | |
/** | |
* Controller's generic middleware | |
*/ | |
export const middleware = [middleware.authenticate('token')] |
NewerOlder