Skip to content

Instantly share code, notes, and snippets.

View tamakiii's full-sized avatar

Daichi Tamaki tamakiii

  • undefined
  • Shibuya, Tokyo, Japan
  • X @tamakiii
View GitHub Profile
@tamakiii
tamakiii / Brewfile
Last active November 21, 2019 12:39
brew "amazon-ecs-cli"
brew "awscli"
brew "coreutils"
brew "docker"
brew "docker-compose"
brew "ffmpeg"
brew "fish"
brew "fzf"
brew "git"
brew "gnu-sed"
php:
...
volumes:
- - .:/project:delegated
+ - project_volume:/project:delegated
+
+ volumes:
+ project_volume:
+ driver_opts:
+ type: none
version: "3.7"
volumes:
project_volume:
driver: local
driver_opts:
type: nfs
device: ":${CURRENT_VOLUME_DIR}"
o: addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3
.PHONY: all clean
DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
ENVIRONMENT := development
PORT_HTTP := 8080
MOUNT_TYPE := consistent
CURRENT_VOLUME_DIR ?= $(realpath $(shell echo $(DIR) | sed 's|/Users|/System/Volumes/Data/Users|'))
.env:
@tamakiii
tamakiii / Convert-SQL-result-table-to-JSON.md
Last active November 24, 2020 12:39
Convert SQL result table to JSON (Rough implementation)
$ cat /tmp/sample.txt
+-------+------+-----------+
| id    | type | parent_id |
+-------+------+-----------+
|     1 |    0 |      NULL |
|     2 |   10 |      NULL |
|     3 |   11 |         2 |
+-------+------+-----------+
@tamakiii
tamakiii / make -np
Created October 12, 2020 13:29
make -np on debian docker
root@f01a24d03a11:/# make -np
make: *** No targets specified and no makefile found. Stop.
# GNU Make 4.2.1
# Built for x86_64-pc-linux-gnu
# Copyright (C) 1988-2016 Free Software Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.
# Make data base, printed on Mon Oct 12 13:28:16 2020
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
import time
class S(BaseHTTPRequestHandler):
def _set_response(self):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
cd /tmp
export COLORSCHEME=gruvbox
export PLUGNAME=morhetz/gruvbox
vim \
-c "call plug#begin('~/.vim/plugged')|Plug '$PLUGNAME'|call plug#end()|PlugInstall --sync|q" \
-c "colorscheme $COLORSCHEME" \
-c 'redir @x|silent highlight|redir END|put x' \
-c 'g/^$/d' \
-c 'g/links to/d' \
-c 'g/cleared$/d' \
<?php
class NumberFormatterTest
{
const STYLES = [
'NumberFormatter::PATTERN_DECIMAL' => NumberFormatter::PATTERN_DECIMAL,
//Decimal format defined by pattern
'NumberFormatter::DECIMAL' => NumberFormatter::DECIMAL,
// Decimal format
'NumberFormatter::CURRENCY' => NumberFormatter::CURRENCY,
@tamakiii
tamakiii / compgen-c.diff
Last active May 5, 2021 11:26
ami-0d14de74618b313e2...amazonlinux:2.0.20210126.0 (docker.io)
--- /dev/fd/11 2021-05-05 18:13:16.000000000 +0900
+++ /dev/fd/13 2021-05-05 18:13:16.000000000 +0900
@@ -3,267 +3,57 @@
:
[
[[
-[ec2-user@ip-10-0-0-0 ~]$ compgen -c
]]
-__expand_tilde_by_ref
-__get_cword_at_cursor_by_ref