Skip to content

Instantly share code, notes, and snippets.

View kota65535's full-sized avatar

Tomohiko Ozawa kota65535

  • Sony
  • Tokyo, Japan
  • 07:38 (UTC +09:00)
  • X @kota65535
View GitHub Profile
@kota65535
kota65535 / DriveConfig.java
Last active July 5, 2023 13:47
GoogleDriveUploader
@Data
public class DriveConfig {
@NotNull
private String credentials;
@NotNull
private String driveId;
@NotNull
@kota65535
kota65535 / rename_project.sh
Last active March 7, 2023 09:00
Rename a sample or boilerplate project to start a new project
#!/usr/bin/env bash
set -euo pipefail
# set -x
export LC_ALL=C
usage() {
cat <<EOF
Rename a project.
Usage:
@kota65535
kota65535 / pre-commit.sh
Created January 18, 2023 18:47
Self-install pre-commit hook script
#!/usr/bin/env bash
set -euo pipefail
# Install pre-commit hook
if [[ $0 != ".git/hooks/pre-commit" ]]; then
cp "$0" .git/hooks/pre-commit
fi
# Do something ...
@kota65535
kota65535 / create_lambda_layer.sh
Last active August 10, 2022 22:01
Create python lambda layer contents
#!/usr/bin/env bash
set -eu -o pipefail
# echo to stderr
eecho() { echo "$@" 1>&2; }
usage() {
cat <<EOF
Usage:
bash $(basename "$0") <python-version> <requirements-file>
This file has been truncated, but you can view the full file.
2021-05-10T11:45:59.934+0900 [INFO] Terraform version: 0.15.1
2021-05-10T11:45:59.934+0900 [INFO] Go runtime version: go1.16.2
2021-05-10T11:45:59.934+0900 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/2.0.0/versions/0.15.1/terraform", "plan", "-out", "plan.out"}
2021-05-10T11:45:59.934+0900 [TRACE] Stdout is a terminal of width 216
2021-05-10T11:45:59.934+0900 [TRACE] Stderr is a terminal of width 216
2021-05-10T11:45:59.934+0900 [TRACE] Stdin is a terminal
2021-05-10T11:45:59.934+0900 [DEBUG] Attempting to open CLI config file: /Users/tozawa/.terraformrc
2021-05-10T11:45:59.934+0900 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2021-05-10T11:45:59.935+0900 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021-05-10T11:45:59.935+0900 [DEBUG] ignoring non-existing provider search directory /Users/tozawa/.terraform.d/plugins
@kota65535
kota65535 / chpwd_for_zsh.sh
Created November 26, 2016 08:11 — forked from yonchu/chpwd_for_zsh.sh
zshにてcd後に自動的にlsを行うchpwd関数。ファイル数が多い場合は省略表示します。(.zshrcに設定して使用します)
chpwd() {
ls_abbrev
}
ls_abbrev() {
# -a : Do not ignore entries starting with ..
# -C : Force multi-column output.
# -F : Append indicator (one of */=>@|) to entries.
local cmd_ls='ls'
local -a opt_ls
opt_ls=('-aCF' '--color=always')
@kota65535
kota65535 / tmux-do-not-combine-utf8.patch
Last active November 23, 2016 17:46 — forked from waltarix/tmux-do-not-combine-utf8.patch
tmux: Fix a problems with displaying Ambiguous-width, Japanese Dakuten and Handakuten signs.
diff --git a/screen-write.c b/screen-write.c
index 2b7fba0..5cd1a48 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1052,6 +1052,7 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
* If the width is zero, combine onto the previous character, if
* there is space.
*/
+ /*
if (width == 0) {
require 'frisky/ssdp'
require 'httpclient'
require 'nokogiri'
require 'json'
require 'bindata'
require 'benchmark'
require 'logger'
require 'byebug'
module Logging
@kota65535
kota65535 / ssdp_addroute_linux.sh
Last active November 23, 2015 04:41
SSDP:Discoverに利用するブロードキャストアドレスの経路追加 (Linux版, Raspberry Pi対応)
#!/bin/bash
set -u
export LANG="C"
function usage() {
cat <<EOT
Usage: bash ${0##*/} <interface-name>
EOT
}
@kota65535
kota65535 / ssdp_addroute_mac.sh
Last active November 23, 2015 04:41
SSDP:Discoverに利用するブロードキャストアドレスの経路追加 (Mac版)
#!/bin/bash
set -u
export LANG="C"
function usage() {
cat <<EOT
Usage: bash ${0##*/} <interface-name>
EOT
}