mkdir foo
cd foo
curl -o "Vagrantfile" "https://gist.githubusercontent.com/masuidrive/20049711692b5f5885c8/raw/171c5027732476f433b6cb97963382e3896fada0/Vagrantfile"
vagrant up && vagrant ssh
# 以下、vagrant内
cd /vagrant
This file contains 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
# install for gcloud cli | |
# https://docs.coder.com/docs/tech-faqs | |
apt install python2.7 python-pip -y | |
# install yarn for node | |
curl -o- -L https://yarnpkg.com/install.sh | sh | |
# install gcloud | |
curl -o- -L https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-219.0.1-linux-x86_64.tar.gz | tar xfz - -C /usr/local |
This file contains 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
find . -name '*.bak' -type f -print0 | xargs -0 -n1 bash -c 'echo "mv \"$0\" ~/\".Trash/`basename \"$0\"`"\"' | sh |
This file contains 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 'open-uri' | |
require 'json' | |
response = open('http://www.idolfes.com/2016/json/timetable/time.json') | |
data = JSON.parse(response.read) | |
artists = {} | |
data.each do |day, stages| | |
stages.each do |stage, items| | |
items.each do |item| |
This file contains 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 | |
rails_version="${RAILS_VERSION:-7}" | |
ruby_version="${RUBY_VERSION:-3.0}" | |
node_version="${NODE_VERSION:-16}" | |
docker run --rm -v `pwd`:/usr/src/app ruby:$ruby_version sh -c "gem install rails --version $rails_version && rails new /usr/src/app --database mysql ${RAILS_OPTIONS} --git --force --version $rails_version" | |
cat << __EOT__ > Dockerfile | |
FROM ruby:$ruby_version |
This file contains 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 | |
# ざっくりとしたメモリとCPU利用率を調べるプロファイラ | |
# ./profiler.rb "HOGE -foo" を実行するとHOGEコマンドを実行して | |
# メモリとCPUの利用率をSTDOUTに書き出します | |
# -p PIDを指定すると、指定したコマンドと同時に指定されたプロセスも | |
# 記録します | |
require "csv" | |
require "optparse" | |
out = STDOUT |
This file contains 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
# rubocop:disable Style/HashSyntax | |
# shoryuken用のタスク | |
namespace :queues do | |
desc 'Create default SNS & SQS' | |
task 'setup' => :environment do | |
# http://qiita.com/takeyuweb/items/cdc262d97c3e863c15ff | |
# TODO | |
end | |
desc "List all SQS queues" |
This file contains 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
/** | |
* Google Spreadsheet向けBigQuery取り込みスクリプト | |
* http://toreta.blog.jp/archives/20649904.html | |
* License: MIT 2014- Toreta, Inc. | |
* | |
* runAllQueries() をトリガーで毎日実行してください | |
* Queries, Single row queries, Dataの三つのシートを作って下さい | |
* Queries, Single row queriesのシートには実行するクエリを書きます | |
* A列にクエリ名、B列にクエリです。 | |
* conuntなどの集約関数で1行しか返らないクエリは「Single row queries」、それ以外は「Queries」に書いて下さい |
This file contains 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/bash | |
protected_branch='develop' | |
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
if [ $protected_branch = $current_branch ] | |
then | |
read -p "You're about to push $protected_branch, is that what you intended? [y/N] " -n 1 -r < /dev/tty | |
echo | |
if echo $REPLY | grep -E '^[Yy]$' > /dev/null |