Skip to content

Instantly share code, notes, and snippets.

@ryosms
ryosms / hosts
Created July 8, 2014 14:44
AnsibleInventoryForVagrant
[normal]
vagrant ansible_ssh_host=192.168.33.10 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key
[loopback]
vagrant ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key
[ip_address]
192.168.33.10 ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key
[loopback_ip]
@ryosms
ryosms / congratulations.py
Last active February 8, 2019 08:40
Create 'CONGRATULATIONS' image from [pixela](https://pixe.la) using [pixela2img](https://github.com/ryosms/pixela2img).
from pixela2img import Pixela2Img
from PIL import Image
converter = Pixela2Img()
congratul = converter.convert('ryosms', 'congratulations', date='20180210')
ations = converter.convert('ryosms', 'congratulations', date='20190216')
width = congratul.width + ations.width + 1
height = congratul.height
@ryosms
ryosms / awesome-batch.ps1
Last active December 20, 2019 06:53
Windowsのバッチ処理の実行結果をmkr wrapとmkr annotationsで確認する
param(
[int]$ExitCode = 0,
[int]$WaitSeconds = 60
)
Write-Output("Start awesome-batch (WaitSeconds: {0})" -f $WaitSeconds)
# wait 1 minute
Start-Sleep -Seconds $WaitSeconds
@ryosms
ryosms / .git_alias
Last active November 27, 2023 02:13
# how to use
# 1. download this file (e.g. ~/.git_alias)
# 2. include this file from .gitconfig
# [include]
# path = ~/.git_alias
[alias]
# Delete all merged local branch
cleanbranch = !"git switch develop && git pull --prune && git branch --merged | egrep -v '(accept|develop|production|master|main)' | xargs -n1 git branch -d"
cb = cleanbranch

git clean_branch

  1. download the git-clean_branch and place it in a directory included in your PATH
  2. (optional) set your default branch name to environment variable GIT_DEFAULT_BRANCH
    • when each repository has a different default branch, it might be convenient to use direnv
  3. (optional) set alias ex. git config alias.cb "clean_branch"
  4. use git clean_branch