Skip to content

Instantly share code, notes, and snippets.

View maemichi-monosense's full-sized avatar

Yuya Ma'emichi maemichi-monosense

View GitHub Profile
version: '3'
services:
# http://php.net/manual/ja/features.commandline.webserver.php
web:
image: php
command: php -S 0.0.0.0:8000 router.php
ports:
- '8000:8000'
working_dir: /web
<?php
namespace ArrayUtils;
/**
* deep get
*
* @param array $array
* @param string|int ...$keys
*
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'aws-sdk-support', '~> 1'
end
sts = Aws::STS::Client.new
pp sts.get_caller_identity
@maemichi-monosense
maemichi-monosense / Dockerfile
Last active December 19, 2018 07:45
PsySH docker
ARG php_version="latest"
FROM php:${php_version}
ARG man_lang="en"
ADD https://psysh.org/psysh /usr/local/bin/
RUN chmod +x /usr/local/bin/psysh
ENV HOME /root
ENV DOC_PATH $HOME/.local/share/psysh/
@maemichi-monosense
maemichi-monosense / Dockerfile
Created June 25, 2018 05:15
Amazon Linux 2, Ruby 2.4
FROM amazonlinux:2
RUN yum -y install yum-plugin-fastestmirror \
&& yum -y update \
;
RUN amazon-linux-extras install -y ruby2.4
CMD tail -f /dev/null
@maemichi-monosense
maemichi-monosense / Dockerfile
Last active June 25, 2018 04:34
Amazon Linux 1, Ruby 2.4
FROM amazonlinux:1
RUN yum -y install yum-plugin-fastestmirror \
&& yum -y update \
;
RUN yum -y install ruby24
CMD tail -f /dev/null
@maemichi-monosense
maemichi-monosense / Dockerfile
Last active June 11, 2018 06:30
PsySH docker
FROM php:alpine
RUN wget https://git.io/psysh \
&& chmod +x psysh \
;
CMD ./psysh
@maemichi-monosense
maemichi-monosense / iter_chunk.php
Last active June 4, 2018 05:52
PHP Generator toybox
<?php
/**
* @see http://blog.kevingomez.fr/2016/02/26/efficiently-creating-data-chunks-in-php/
*
* @param Iterator $iterable
* @param int $size > 0
*
* @return Generator {int => Generator}
*/
#!/usr/bin/env bash -x
# set -x
export AWS_DEFAULT_REGION=us-east-1
lang=en
account_id=$(aws sts get-caller-identity | jq -r '.Account')
aws support describe-trusted-advisor-checks \
--language $lang \
@maemichi-monosense
maemichi-monosense / Makefile
Created July 27, 2016 03:52
SSH/Config Makefile
CP := cp -p
CONFIG_FILES := $(wildcard conf.d/*.conf)
SSH_DIR := $(HOME)/.ssh
define USAGE
Usage:
it make ~/.ssh/{config, keylist.txt}
usage show this
help same as usage
update git update