This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'optparse' | |
require 'ostruct' | |
params = OpenStruct.new(count: 1) | |
opt = OptionParser.new | |
opt.on('-n INT') { |v| params.count = v.to_i } | |
opt.parse!(ARGV) | |
params.count.times do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef mysqldef psqldef mssqldef sqlite3def | |
# ------------------------------------------------------------------------------ | |
# Copyright (c) 2021 Kazuya Takeshima | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
declare -a devices=($(adb devices | sed '1,1d' | awk '{ print $1 }')) | |
for device in ${devices[@]}; do | |
declare cmd="adb -s ${device} ${@}" | |
echo "${cmd}" | |
eval "${cmd}" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRC = $(CURDIR)/ | |
DEST = user@host:/path/to/ | |
EXCLUDES = .git config log vendor | |
OPTIONS = -razv --delete | |
EXCLUDE_OPTIONS = $(foreach path,$(EXCLUDES),--exclude=$(path)) | |
.PHONY: push push-force pull pull-force | |
all: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SOURCES = $(shell find *.puml) | |
TARGETS = $(SOURCES:%.puml=%.svg) | |
k := $(if $(shell which plantuml),,$(error "No plantuml executable in PATH")) | |
all: clean $(TARGETS) | |
%.svg: %.puml | |
cat $< | plantuml -tsvg -pipe > $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
from ebcli.core import fileoperations, io | |
from ebcli.lib import aws, elasticbeanstalk, utils | |
from ebcli.operations import commonops, envvarops | |
try: | |
parser = argparse.ArgumentParser(usage='deploy [environment_name] [--revision REVISION] [--timeout TIMEOUT]') | |
parser.add_argument('environment_name', action='store', nargs='?', default=None, type=str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
aws --region=ap-northeast-1 ec2 describe-instances \ | |
--query 'Reservations[*].Instances[*].{Name:Tags[?Key==`Name`]|[0].Value,Instance:InstanceId,Ip:PrivateIpAddress}' \ | |
| jq '.[] | .[]' \ | |
| jq --raw-output --slurp 'sort_by(.Name) | .[] | select(.Ip != null) | "Host " + .Name + "-" + .Instance, " HostName " + .Ip, ""' \ | |
> /home/ec2-user/.ssh/config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": "tslint:latest", | |
"rules": { | |
"array-type": [true, "generic"], | |
"arrow-parens": [true, "ban-single-arg-parens"], | |
"curly": [true, "ignore-same-line"], | |
"interface-name": false, | |
"max-classes-per-file": false, | |
"max-line-length": [true, 140], | |
"member-access": false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function() { | |
this.nuxt.options.extensions.push('ts') | |
this.extendBuild(config => { | |
config.module.rules.push( | |
{ | |
test: /\.tsx?$/, | |
loader: 'ts-loader', | |
options: { | |
appendTsSuffixTo: [/\.vue$/] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
puts ARGV.join(' ').codepoints.map { |cp| | |
if ('A'..'Z').flat_map(&:codepoints).include?(cp) | |
cp + '𝘼'.codepoints.first - 'A'.codepoints.first | |
elsif ('a'..'z').flat_map(&:codepoints).include?(cp) | |
cp + '𝗮'.codepoints.first - 'a'.codepoints.first | |
else | |
cp | |
end |