Skip to content

Instantly share code, notes, and snippets.

View sunaoka's full-sized avatar

SUNAOKA Norifumi sunaoka

View GitHub Profile
@sunaoka
sunaoka / bref-php-zip-layer.md
Created April 16, 2025 05:13
bref php zip layer

Makefile

all:
	$(RM) -r $(CURDIR)/dist
	docker run --rm \
		-v $(CURDIR):/root \
		-v $(CURDIR)/dist:/tmp/lambda-layer \
		--entrypoint /bin/bash \
 bref/arm-php-84-console:2 \
@sunaoka
sunaoka / world_ja.js
Created November 27, 2024 07:52
jsVectorMap world (ja_JP)
jsVectorMap.addMap("world_ja", {
insets: [{
top: 0,
left: 0,
width: 900,
height: 440.70631074413296,
bbox: [
{ y: -12671671.123330014, x: -20004297.151525836 },
{ y: 6930392.025135122, x: 20026572.39474939 }
]
@sunaoka
sunaoka / Deletes all endpoints for devices and mobile apps from Amazon SNS.bash
Created November 14, 2024 04:48
Deletes all endpoints for devices and mobile apps from Amazon SNS
#!/bin/bash -x
# Deletes all endpoints for devices and mobile apps from Amazon SNS
set -ue
platform_application=<your platform application arn>
aws sns list-endpoints-by-platform-application --platform-application-arn "${platform_application}" |
jq -r '.Endpoints[].EndpointArn' |
while IFS= read -r endpoint; do
find . -maxdepth 3 -name .git -print0 \
  | xargs -0 dirname \
  | xargs -r -I{} git --no-pager -C {} gc --aggressive --prune=now
diff -urd --exclude vendor --exclude composer.lock laravel-10.0/.env laravel-11.0/.env
--- laravel-10.0/.env 2024-03-13 10:32:39
+++ laravel-11.0/.env 2024-03-13 10:32:51
@@ -1,36 +1,54 @@
APP_NAME=Laravel
APP_ENV=local
-APP_KEY=base64:SpHwH7V060ReXjch6ksAXWNLPJ9z9iPYKRSUZzTSr/g=
+APP_KEY=base64:pCIm9KJkg0GFtbzCdq0VweTp4S6S9GDhOccpZmrWp0A=
APP_DEBUG=true
+APP_TIMEZONE=UTC
aws ec2 describe-images \
  --region ap-northeast-1 \
  --query 'reverse(sort_by(Images, &CreationDate))[:1]' \
  --owners amazon \
  --filters 'Name=name,Values=al2023-ami-minimal-*-arm64' \
  --output table
{
"// Pint preset": "https://github.com/laravel/pint/blob/main/resources/presets/laravel.php",
"// PHP-CS-Fixer Configurator": "https://mlocati.github.io/php-cs-fixer-configurator",
"// binary_operator_spaces": "配列の => でキーと値のペアをそろえる",
"// blank_line_before_statement": "return や continue の前に空行は不要",
"// no_extra_blank_lines": "余分な空白行や空白行を削除(デフォルトの throw を外す。cache の直前の throw の空行が削除されるため)",
"// declare_strict_types": "declare(strict_types=1); を追加",
"// explicit_string_variable": "文字列に埋め込まれている変数を {} で囲む",
"preset": "laravel",
"cache-file": ".build/pint-cache.json",
@sunaoka
sunaoka / Mountpoint for Amazon S3 v1.0.0.md
Last active August 10, 2023 04:42
Mountpoint for Amazon S3 v1.0.0

Mountpoint for Amazon S3 v1.0.0

検証環境

cat /etc/os-release
@sunaoka
sunaoka / bootstrap5-responsive-debug.html
Last active June 23, 2023 01:08
Bootstrap5 Responsive Debug
<div id="responsive-debug" class="alert alert-danger opacity-75 position-fixed top-0 end-0 m-3" style="z-index: 2000;"></div>
<script>
const showResponsiveDebug = function () {
const breakPoint = (function (width) {
switch (true) {
case width >= 1400: return 'xxl';
case width >= 1200: return 'xl';
case width >= 992: return 'lg';
case width >= 768: return 'md';
case width >= 576: return 'sm';
@sunaoka
sunaoka / build-boost-on-macos.sh
Last active June 16, 2023 05:15
Build Boost on macOS
sudo mkdir -p /usr/local/boost
sudo chown $USER /usr/local/boost
curl -L -o boost_1_81_0.tar.bz2 https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2
tar -jxvf boost_1_81_0.tar.bz2
echo 'using darwin : : clang++ ;' > user-config.jam
./bootstrap.sh --prefix=/usr/local/boost \