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
# coding: utf-8 | |
def get_cost(d, c1, x, c2, y) | |
costs = [] | |
if c1 == c2 | |
# 同じ場合 | |
costs << d[y-1][x-1] | |
end | |
if c1 != c2 |
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
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
// localhost:8080/ retrun exec folder | |
// localhost:8088/.... return same name file | |
// localhost:8080/handler return url path(from handler function) |
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
/* | |
Usage: | |
# get https://github.com/robdimsdale/wl | |
go get -u github.com/robdimsdale/wl | |
# set up wunderlist setting for wl | |
go build report.go | |
wl tasks --completed true -j | ./report | |
2015-11-30 10 tasks completed |
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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" | |
gem "activesupport" | |
end |
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
def badName(test) | |
puts test and false | |
end | |
badName(42) |
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
git diff -z — name-only origin/master | xargs -0 bundle exec rubocop-select | xargs bundle exec rubocop — require rubocop/formatter/checkstyle_formatter — format RuboCop::Formatter::CheckstyleFormatter | RUBYOPT=-EUTF-8 bundle exec checkstyle_filter-git diff origin/master | RUBYOPT=-EUTF-8 bundle exec saddler report — require saddler/reporter/github — reporter Saddler::Reporter::Github::PullRequestReviewComment |
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
# 環境変数GITHUB_TOKENの設定が必要 | |
# LABEL_NAMEに設定した名前のラベルをIssueに付けて作成する | |
# Issueの名前はrubocopのルールの名前と完全に一致する | |
# old_rubocop_rule.ymlの中に同じルールがあった場合はその内容をbodyに加える | |
require 'yaml' | |
require 'octokit' | |
LABEL_NAME = 'rubocop-auto-config' |
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
# 環境変数GITHUB_TOKENの設定が必要 | |
# todo_labelに設定したラベルが付いているIssueを調べ、 | |
# auto_corrected_labelが付いていないものに対して`rubocop -auto_correct`を実行して結果をPull Requestにする | |
# 前提条件 | |
# - Issueのタイトルがrubocopの設定名と完全に一致している | |
# - repo_local_pathフォルダにgit cloneしてある | |
# - repo_base_branchに設定したブランチが存在する | |
# - git pushができる | |
require "open3" |
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 "erb" | |
erb_obj = ERB.new("<%=name%> \"Hello <%=first_name%> <%=last_name%>!\"") | |
name = 'honoka' | |
last_name = 'kousaka' | |
puts erb_obj.result_with_hash(first_name: 'kotori', last_name: 'minami') | |
puts "Top level name is #{name}, #{last_name}" |