Skip to content

Instantly share code, notes, and snippets.

@n1215
n1215 / Main.elm
Last active January 18, 2020 01:20
timer event sourcing elm
module Main exposing (main)
import Browser
import Browser.Events exposing (onAnimationFrame)
import Html exposing (Html, button, div, p, table, tbody, td, text, th, thead, tr)
import Html.Events exposing (onClick)
import List
import Task
import Time
import Tuple
<?php
// EloquentのEager Loadを無理やり使うバージョン
/** @var \Illuminate\Support\Collection<\stdClass> $userAndPoints */
$userAndPoints = Status::query()
->with('user.userDetail')
->select('user_id')
->selectRaw('sum(point) As point')
->groupBy('user_id')
@n1215
n1215 / cakephperize.php
Last active April 1, 2021 01:37
cakephperize
<?php
declare(strict_types=1);
/**
* (experimental)
* cakephperize your icons
*
* usage)
* $ php cakephperize.php {file_url} {threshold}
@n1215
n1215 / UserRepositoryInterface.ts
Last active April 21, 2021 06:49
TypeScript classless DI container design
export type User = {
id: number
name: string
}
export interface UserRepositoryInterface {
list(): User[]
}
@n1215
n1215 / Procfile
Last active September 13, 2023 15:29
build settings for Laravel + Heroku Buildpacks on AWS App Runner/Google Cloud Run
web: heroku-php-nginx -C nginx.conf public
@n1215
n1215 / Procfile
Last active June 15, 2023 03:50
build a Laravel app container image using Google Cloud's Buildpacks
web: pid1 --nginxBinaryPath nginx --nginxConfigPath /layers/google.php.webconfig/webconfig/nginx.conf --serverConfigPath /workspace/nginxserver.conf --nginxErrLogFilePath /layers/google.php.webconfig/webconfig/nginx.log --customAppCmd "php-fpm -R --nodaemonize --fpm-config /layers/google.php.webconfig/webconfig/php-fpm.conf" --pid1LogFilePath /layers/google.php.webconfig/webconfig/pid1.log --mimeTypesPath /layers/google.utils.nginx/nginx/conf/mime.types --customAppSocket /layers/google.php.webconfig/webconfig/app.sock