Skip to content

Instantly share code, notes, and snippets.

View shin1x1's full-sized avatar
😀

Masashi Shinbara shin1x1

😀
View GitHub Profile
<?php
function fib_match(int $i): int
{
return match($i) {
1,2 => 1,
default => fib_match($i - 1) + fib_match($i - 2),
};
}
#!/usr/bin/env php
<?php
use Koriym\Spaceman\Convert;
require __DIR__ . '/vendor/autoload.php';
if ($argc < 3) {
echo "Usage: spaceman NAMESPACE DIR", PHP_EOL;
exit(1);
version: '3'
services:
nginx:
image: shin1x1/laravel-nginx118
ports:
- '8000:80'
volumes:
- .:/var/www/html
depends_on:
- php
package variant
import (
"bufio"
"fmt"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"os"
"os/exec"
"strings"
<?php
namespace Acme\Application\Action;
use Acme\Application\Repository\UserPaginatorRepository;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Pagination\Paginator;
final class UserListAction
{
<?php
namespace Acme\Infrastructure\Repository;
use Acme\Domain\Exception\NotFoundException;
use Acme\Domain\Model\PointEmail;
use Acme\Domain\Model\UserId;
use Acme\Domain\Repository\PointEmailRepository;
use Acme\Infrastructure\Eloquent\EloquentUser;
<?php
namespace Acme\Domain\Repository;
use Acme\Domain\Model\PointEmail;
use Acme\Domain\Model\UserId;
interface PointEmailRepository
{
/**
<?php
namespace Acme\Infrastructure\Repository;
use Acme\Domain\Exception\NotFoundException;
use Acme\Domain\Model\User;
use Acme\Domain\Model\UserId;
use Acme\Domain\Repository\UserRepository;
use Acme\Infrastructure\Eloquent\EloquentUser;
@shin1x1
shin1x1 / UserRepository.php
Last active June 23, 2019 03:21
repository-with-laravel
<?php
namespace Acme\Domain\Repository;
use Acme\Domain\Model\User;
use Acme\Domain\Model\UserId;
interface UserRepository
{
/**
@shin1x1
shin1x1 / wake.go
Last active April 18, 2019 03:50
package main
import (
"fmt"
"log"
"os"
"os/exec"
"sync"
"time"
)