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 'package:dio/dio.dart'; | |
import 'package:curl_logger_dio_interceptor/curl_logger_dio_interceptor.dart'; | |
import 'interceptors/csrf_token_interceptor.dart'; | |
class Api { | |
final Dio dio; | |
Api(this.dio) : super() { | |
dio.interceptors.addAll([ |
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\Console\Commands\Horizon; | |
use Illuminate\Console\Command; | |
use Illuminate\Queue\Failed\FailedJobProviderInterface; | |
use Laravel\Horizon\Contracts\JobRepository; | |
use Laravel\Horizon\Jobs\RetryFailedJob; | |
class RetryAllFailedJobsCommand extends Command |
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 | |
Builder::macro('deferredPaginate', function ($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { | |
$model = $this->newModelInstance(); | |
$key = $model->getKeyName(); | |
$table = $model->getTable(); | |
$paginator = $this->clone() | |
// We don't need them for this query, they'll remain | |
// on the query that actually gets the records. |
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 | |
/** | |
----------------------------------------------------- | |
Enforce the Laravel Code Style using PHP CS Fixer 3.x | |
----------------------------------------------------- | |
Credits go to Laravel Shift & Andreas Elia. | |
https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200 | |
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
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 | |
// Nodes. | |
abstract class Node implements Visitable {} | |
class Number extends Node { | |
public function __construct(public float $value){} | |
public function accept(Visitor $visitor) { | |
return $visitor->visitNumber($this); | |
} |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
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 | |
$rounds = (int) $argv[1]; | |
$callback = 'rdp_simplify'; | |
if (! function_exists( $callback ) ) | |
{ | |
include 'rdp.php'; | |
$callback = [ 'RDP', 'simplify' ]; | |
} |
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
FROM php:7.4-fpm-alpine | |
WORKDIR "/application" | |
# Install essential build tools | |
RUN apk add --no-cache \ | |
git \ | |
yarn \ | |
autoconf \ | |
g++ \ | |
make \ |
NewerOlder