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
### | |
# Post coverage rate to Slack | |
# | |
# Usage: bash circleci-coverage-slack.sh [cobertura|jacoco] | |
# | |
# Required environment variables: | |
# | |
# - CIRCLE_TOKEN: project-specific readonly API token (need to access build artifacts for others) | |
# - SLACK_ENDPOINT: Slack endpoint url | |
# - COVERAGE_FILE: coverage xml filename (default: coverage.xml) |
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 'net/http' | |
keywords = ['hoge', 'bar', 'mofu'] | |
i = 1 | |
while true | |
puts "#{i} length challenge." | |
# repeated_combination is also useful. | |
keywords.combination(i).each do |keywords| |
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 'json' | |
KEYS = { '11' => '1', '12' => '2', '13' => '3', '14' => '4', | |
'15' => '5', '16' => '0', '18' => '6', '19' => '7' } | |
notes = [] | |
open(ARGV[0]).each_line do |line| | |
arr = line.scan(/^#(\d{3,3})(\d{2,2}):(\w+)/) | |
next unless arr[0] | |
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
class Hash | |
def max_depth | |
max_depth = 1 | |
depth_func = ->(hsh, cur_depth) do | |
max_depth = cur_depth if cur_depth > max_depth | |
hsh["children"].to_a.each{|h| depth_func.call(h, cur_depth+1)} | |
max_depth | |
end | |
depth_func.call(self, 0) | |
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
#!/usr/bin/perl | |
use MIME::Base64; | |
use MIME::QuotedPrint::Perl; | |
my $mail_file = $ARGV[0]; | |
open( FILE, $mail_file) or die "$!"; | |
my $mail_content = ""; | |
while ( <FILE> ) { |