Skip to content

Instantly share code, notes, and snippets.

Avatar

Takashi Masuda masutaka

View GitHub Profile
View README.md

1. Create Dataset

$ bq mk sandbox_masutaka

2. Setup orders Table

$ bq mk --table --schema=./orders.json sandbox_masutaka.orders
View direnv.patch
--- Makefile.orig 2020-03-26 22:38:05.000000000 +0900
+++ Makefile 2020-03-26 22:39:57.000000000 +0900
@@ -1,9 +1,10 @@
+DIRENV := direnv
MAKE := make
TARGETS := aws heroku
define make-r
@for i in $(TARGETS); do \
- $(MAKE) -w -C terraform/$$i $(1) || exit $$?; \
@masutaka
masutaka / 00tree.txt
Last active Mar 26, 2020
Makefiles for terraform
View 00tree.txt
.
├── Makefile # (1)
└── terraform
    ├── aws
    │   ├── Makefile # (2)
    │ └── main.tf
    └── heroku
    ├── Makefile # (3)
    └── main.tf
@masutaka
masutaka / .rubocop.yml
Created Feb 25, 2020
Forbid Dir.chdir using rubocop custom cop
View .rubocop.yml
require:
- ./lib/rubocop/cop/hoge
@masutaka
masutaka / oneshot_base_job.rb
Created Dec 11, 2019
sample one-shot job on Heroku
View oneshot_base_job.rb
# @abstract One-shot 関連のジョブは必ずこの class を継承し、
# キーワード引数に :global_executions を要求する #perform を実装すること
class OneshotBaseJob < ApplicationJob
class << self
# Retry the One-shot job due to the exception
#
# @param job [OneshotBaseJob] A One-shot job class to retry
# @return [void]
#
# @note See ActiveJob::Exceptions::ClassMethods#retry_on for the parameters except to `job`
@masutaka
masutaka / test.js
Last active Aug 10, 2019
esa.io の通常カテゴリと、Archived カテゴリを行ったり来たりするブックマークレット
View test.js
if (/esa\.io\/#path=%2FArchived%2F/.test(location.href)) {
location.href = location.href.replace(/#path=%2FArchived%2F/, '#path=%2F');
} else if (/esa\.io\/#path=%2F/.test(location.href)) {
location.href = location.href.replace(/#path=%2F/, '#path=%2FArchived%2F');
}
@masutaka
masutaka / git-push.log
Created Apr 26, 2019
Heroku Buildpack research
View git-push.log
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
View main.workflow
# For issues
workflow "issues" {
on = "issues"
resolves = ["Add an issue to project"]
}
action "Add an issue to project" {
uses = "docker://masutaka/github-actions-all-in-one-project"
secrets = ["GITHUB_TOKEN"]
@masutaka
masutaka / 00Overview
Created Feb 1, 2019
All in one GitHub Project using GitHub Actions
View 00Overview
.github
├── main.workflow (01main.workflow)
└── project
├── Dockerfile
└── entrypoint.sh
@masutaka
masutaka / 00Overview
Last active Jan 27, 2019
A sample files of GitHub Actions
View 00Overview
.github
├── hadolint
│ ├── Dockerfile (hadolint_Dockerfile)
│   └── entrypoint.sh (hadolint_entrypoint.sh)
├── main.workflow (01main.workflow)
└── shellcheck
├── Dockerfile (shellcheck_Dockerfile)
└── entrypoint.sh (shellcheck_entrypoint.sh)