Skip to content

Instantly share code, notes, and snippets.

View wata727's full-sized avatar

Kazuma Watanabe wata727

View GitHub Profile
@wata727
wata727 / debug.log
Created November 7, 2022 17:00
terraform: Can't use known variables in dynamic block labels
2022-11-07T16:54:53.812Z [INFO] Terraform version: 1.3.4
2022-11-07T16:54:53.812Z [DEBUG] using github.com/hashicorp/go-tfe v1.9.0
2022-11-07T16:54:53.812Z [DEBUG] using github.com/hashicorp/hcl/v2 v2.14.1
2022-11-07T16:54:53.812Z [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2022-11-07T16:54:53.812Z [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2022-11-07T16:54:53.812Z [DEBUG] using github.com/zclconf/go-cty v1.12.0
2022-11-07T16:54:53.812Z [INFO] Go runtime version: go1.19.3
2022-11-07T16:54:53.812Z [INFO] CLI args: []string{"terraform", "plan"}
2022-11-07T16:54:53.812Z [TRACE] Stdout is a terminal of width 123
2022-11-07T16:54:53.812Z [TRACE] Stderr is a terminal of width 123
(require 'lsp-mode)
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("bundle" "exec" "steep" "langserver"))
:major-modes '(ruby-mode enh-ruby-mode)
:priority -2
:server-id 'steep-ls))
(add-hook 'ruby-mode-hook #'lsp)
equire "rugged"
def diff_between_parent(commit)
return if commit.parents.empty?
parent = commit.parents.inject do |ret, item|
commit.diff(ret).size < commit.diff(item).size ? ret : item
end
commit.diff(parent).each_patch do |patch|
patch.each_hunk do |hunk|
@wata727
wata727 / main.go
Created October 8, 2018 08:08
go/types: type check is failed with custom importer (golang.org/x/tools/go/packages)
package main
import (
"go/ast"
"go/parser"
"go/token"
"go/types"
"io/ioutil"
"golang.org/x/tools/go/packages"
@wata727
wata727 / user.php
Last active November 29, 2015 17:26
FuelPHPでdbunitを使ってテストするサンプル
<?php
/**
* 使用バージョン
* FuelPHP 1.7.0
* PHPUnit 4.8.18
* DBUnit 2.0.2
*
* /user/createはGETメソッドで単純に決められたデータを登録するだけのイメージ
*
@wata727
wata727 / add_menulist.pl
Last active September 20, 2015 18:17
kobayasitabelにTwitterからメニューを登録するスクリプト
#!/usr/bin/perl
use strict;
use warnings;
use Encode;
use Net::Twitter;
use Text::MeCab;
use LWP::UserAgent;
use HTTP::Request::Common;
@wata727
wata727 / control-sg-myip.sh
Created February 22, 2015 10:28
自分のIPをSecurityGroupに登録する。22,80,8080,8090番を許可、無効化する
#!/bin/bash
# example : sh control-sg-myip.sh [action]
# action -> [auth,revoke]
if [ $# -ne 1 ]; then
echo "Error: Invalid argument count." 1>&2
exit 1
fi
sgid='sg-XXXXXXXX'
myip=`curl -s ifconfig.me`
@wata727
wata727 / instance-controller.sh
Created February 15, 2015 11:49
EC2のNameタグ名でインスタンスの起動、停止を行う。aws-cliとjqを使用。
#!/bin/bash
# example: sh instance-controler.sh [action] [name]
# action -> [start,stop]
# name -> ec2 tag name
if [ $# -ne 2 ]; then
echo "Error: Invalid argument count." 1>&2
exit 1
fi
action=$1
name=$2