Skip to content

Instantly share code, notes, and snippets.

View pyar6329's full-sized avatar

Tsukasa Arima pyar6329

View GitHub Profile
@ybelleguic
ybelleguic / minikube.service
Last active May 1, 2021 08:15
minikube systemd unit
[Unit]
Description=Minikube Service
After=libvirtd.service
After=libvirtd.socket
After=network-online.target
After=libvirt-guests.service
[Service]
Type=oneshot
@pyar6329
pyar6329 / docker-compose.yml
Last active March 29, 2019 00:23
CockroachDB 4 clusters
version: '3.7'
services:
cockroach1:
image: cockroachdb/cockroach:v2.1.6
container_name: sample-cockroach-1
command: start --insecure
networks:
sample:
aliases:
- sample-cockroach-1
@pyar6329
pyar6329 / hhkb_layout.txt
Created January 24, 2018 23:32
Happy Hacking Keyboard layout raw data (http://www.keyboard-layout-editor.com/)
["esc","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=","|\n\\","~\n`"],
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"Delete"],
[{w:1.75},"Ctrl","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Return"],
[{w:2.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:1.75},"Shift","Fn"],
[{x:1.25,w:1.25},"Option",{w:1.25},"⌘",{a:7,w:6.25},"",{a:4,w:1.25},"⌘",{w:1.25},"Option"]
@posener
posener / go-table-driven-tests-parallel.md
Last active April 30, 2024 20:34
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@pyar6329
pyar6329 / .envrc
Last active May 23, 2018 21:26
direnv loading env_file of docker-compose
eval $(cat "$(pwd)/docker/env/envfile.env" | grep -v "#" | awk -F= {'print "export "$1"=\""$2"\""'})
@pyar6329
pyar6329 / new_phoenix.sh
Created October 24, 2017 02:24
phoenix project generator
function new_phoenix(){
mix archive.install --force https://github.com/phoenixframework/archives/raw/master/phx_new.ez
mix phx.new $1 --no-brunch --no-ecto --no-html --binary-id
}
new_phoenix foobar
@pyar6329
pyar6329 / FromEscapeToJapanese_eisuu.json
Last active September 21, 2017 06:19
karabiner elements configs (esc, ctrl-g, ctrl-sで日本語入力off)
{
"title": "Terminal等でESCあるいはctrl-gあるいはctrl-sで日本語入力を英数に",
"rules": [
{
"description": "TerminalまたはMacVimでESCあるいはctrl-gあるいはctrl-sを押したときに日本語入力を英数に切り替える。",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
@pyar6329
pyar6329 / minikube.sh
Last active September 15, 2017 05:30
minikube startup
# docker for macを入れる
$ brew install docker-machine-driver-xhyve --without-docker-machine
$ sudo chown root:wheel /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ rm -rf /usr/local/bin/VBox* /usr/local/bin/VirtualBox # virtualbox入れた場合はアンインストールして消す
$ minikube start --vm-driver=xhyve --memory=2048 --cpus=4
$ kubectl config use-context minikube
@pyar6329
pyar6329 / markdown.md
Last active September 14, 2017 07:09
github markdown sample

MultiMarkdown

Headers

This is an

tag

This is an

tag

This is an
tag

Emphasis

@MisaKondo
MisaKondo / gcp_2016_advent-calendar_1.md
Last active May 29, 2023 00:43
TerraformによるGCP環境の管理

この記事はGoogle Cloud Platform(1) Advent Calendar 2016の3日目となります!

Google Cloud Platform(以下、GCP)のサービスも一部はTokyoにようやくRegionが来たことだし、そろそろ利用してみたいと思った人も多いのではないでしょうか。 今回は、Google Compute Engine(以下、GCE)をTerraformを利用して構成管理をしてみます。

特に意味はないですが、気づいたら文字ばかりだったので、下記に今回利用するサービスのロゴを載せます。

GCP Terraform
gcp terraform