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
<?php
/**
$ cat composer.json
{
"require": {
"symfony/yaml": "^3.2"
}
}
<?php
/**
$ cat composer.json
{
"require": {
"symfony/yaml": "^3.2"
}
}
@tamakiii
tamakiii / tmux-resurrect.md
Created August 28, 2018 07:09
How to reset tmux-resurrect
@tamakiii
tamakiii / Makefile.sh
Last active October 9, 2018 09:37
Makefile differences between `=`, `:=` and `?=` when $(shell ...)
# ref: What is the difference between the GNU Makefile variable assignments =, ?=, := and +=?
# https://stackoverflow.com/questions/448910/what-is-the-difference-between-the-gnu-makefile-variable-assignments-a
/tmp/makefile
❯ cat Makefile
MATTE := $(shell sleep 10 && echo "matta")
hoge:
echo "$(MATTE)"
date -R
# ssm start-session with fzf
aws ssm start-session --target $(aws ec2 describe-instances | jq -cC '.Reservations[].Instances[] | select(.Tags[].Key == "Name") | {Name: .Tags[].Value, InstanceId: .InstanceId }' | fzf --ansi | jq -r '.InstanceId')
# get instances which have publicDnsName
aws ec2 describe-instances | jq -c '.Reservations[].Instances[] | select(.Tags[].Key == "Name") | select(.PublicDnsName != "") | select(.State.Name == "running") | {"Name": .Tags[].Value, "InstanceId": .InstanceId, "PublicDnsName": .PublicDnsName }' | fzf | jq -r '.PublicDnsName'
# - https://github.com/github/hub
# - https://github.com/junegunn/fzf
# - https://stedolan.github.io/jq/
# - http://linuxcommand.org/lc3_adv_tput.php
# - https://unix.stackexchange.com/questions/26576/how-to-delete-line-with-echo
# - https://www.ibm.com/developerworks/jp/aix/library/au-learningtput/index.html
(ROOT_DIR=~/Sites && echo -n "Organization: " && ORGANIZATION=$(if type hub 2>&1 > /dev/null; then hub api /user/orgs | jq -r '.[].login' | fzf --no-sort --layout=reverse --height=20; else read X && echo $X; fi); [[ -z "$ORGANIZATION" ]] && echo "Please specify organization" && exit 1 || echo -ne "$(tput el)" && echo -n "Repository: " && read REPOSITORY && echo -n "$(tput cuu1)$(tput el 2)" && echo -n "Create $(tput setaf 2)\"${ORGANIZATION}/${REPOSITORY}\"$(tput sgr0)? (y/N): " && read yn; [[ $yn != [yY] ]] && exit 3 || [[ -d "${ROOT_DIR}/${ORGANIZATION}/${REPOSITORY}" ]] && echo "Directory already exists" && exit 2 || mkdir ${ROOT_DIR}/${ORGANIZATION}/${REPOSITORY} && cd $_ && git init && echo "# ${RE
@tamakiii
tamakiii / Makefile.diff
Last active May 31, 2019 04:56
sign.mk
--- all.mk 2019-05-31 13:54:18.000000000 +0900
+++ Makefile 2019-05-31 13:52:54.000000000 +0900
@@ -1,7 +1,6 @@
! := '!!!'
@ := '@@@'
# := '###'
-$ := '$$$'
% := '%%%'
^ := '^^^'
& := '&&&'
@tamakiii
tamakiii / gist:1de28c12a8c8c6a0e6b4541931d0c4fc
Last active July 18, 2019 04:14
Test on Circle CI with Phantomjs and Karma fail

Fail like this

Running "karma:unit" (karma) task
17 07 2019 11:44:24.578:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
17 07 2019 11:44:24.579:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
17 07 2019 11:44:24.582:INFO [launcher]: Starting browser PhantomJS
17 07 2019 11:44:24.633:ERROR [phantomjs.launcher]: Auto configuration failed
140200331615872:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: cannot open shared object file: No such file or directory
140200331615872:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
140200331615872:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf
<html>
<head>
<title>Table JS sample</title>
</head>
<body>
<table class="main" border="1">
<thead>
<tr>
<th>
@tamakiii
tamakiii / main.yml
Last active November 21, 2019 12:16
name: CI
on: [push]
jobs:
test:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v1