Skip to content

Instantly share code, notes, and snippets.

View tsub's full-sized avatar

Tsubasa Takayama tsub

View GitHub Profile
@tsub
tsub / Gemfile
Last active March 15, 2020 17:42
Test codes to reproduce not thread-safe errors of Dynamoid
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'dynamoid'
gem 'pry-byebug', platforms: :ruby
gem 'rake'
@tsub
tsub / .env.template
Last active July 2, 2019 13:12
esa の記事のカテゴリを整理するための雑スクリプト群
ESA_ACCESS_TOKEN=
ESA_TEAM=
@tsub
tsub / github-subscribe-my-repositories.sh
Last active June 5, 2019 09:17
自分のリポジトリをまとめて watch するやつ
#!/bin/sh
PAGE=$1
SUBSCRIPTION_URLS=$(curl -s -H "Authorization: Bearer $GITHUB_API_TOKEN" "https://api.github.com/user/repos?affiliation=owner&page=$PAGE&per_page=100" | jq -r '.[] | select(.fork == false) | .subscription_url')
for url in $SUBSCRIPTION_URLS; do
RESPONSE=$(curl -s -H "Authorization: Bearer $GITHUB_API_TOKEN" "$url" | jq -r '.url')
if [ "$RESPONSE" = "null" ]; then

Keybase proof

I hereby claim:

  • I am tsub on github.
  • I am tsub (https://keybase.io/tsub) on keybase.
  • I have a public key ASDvCT32kIM-W-kIJCn5ePMlvGNbd2DASrioCqY5dXQtaQo

To claim this, I am signing this object:

@tsub
tsub / settings.yml
Last active October 11, 2022 08:28
github-nippou settings
format:
subject: ':github: **%{subject}**'
line: '* %{status} [%{title}](%{url}) by :@%{user}:'
dictionary:
status:
merged: ':git-merge:'
closed: ':issue-closed:'
@tsub
tsub / ticker-signal-demo.go
Created September 30, 2017 12:01
demo for using time.Ticker and os.Signal
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"time"
)
@tsub
tsub / remove-untagged-images-for-ecr
Created August 16, 2017 08:10
Remove untagged images for ECR
#!/bin/sh
set -eu
type aws > /dev/null 2>&1 && type jq > /dev/null 2>&1 || {
echo 'Required aws-cli and jq'
exit 1
}
repositories=$(aws ecr describe-repositories --query 'repositories[*].repositoryName' | tr -d "[\",\t\n\r\"]")
function history-fzf() {
local tac
if which tac > /dev/null; then
tac="tac"
else
tac="tail -r"
fi
BUFFER=$(history -n 1 | eval $tac | fzf --query "$LBUFFER")
function ghq-fzf() {
local selected_dir=$(ghq list | fzf --query="$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd $(ghq root)/${selected_dir}"
zle accept-line
fi
zle reset-prompt
}
@tsub
tsub / 0_reuse_code.js
Created January 26, 2016 07:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console