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
# kaigi on rails 2023@zaak | |
git clone --depth=1 https://github.com/rails/rails | |
cd rails | |
git clone --depth=1 https://github.com/rails/buildkite-config.buildkite | |
# examle: sqlite3 test | |
docker-compose -f .buildkite/docker-compose.ylm run default runner activerecord 'rake sqlite3:test' |
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
timeago() { | |
if [ -n "$1" ] | |
then | |
gdate +"%Y-%m-%d" -d "$1 ago" | |
else | |
gdate +"%Y-%m-%d" -d "$1 week ago" | |
fi | |
} | |
summary() { |
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 -W0 | |
require "date" | |
require "time" | |
require "garoon-cat" | |
require_relative "./schedule" | |
class GaroonScheduler | |
WSDL_URI = "https://info2.nri-net.com/cgi-bin/cbgrn/grn.cgi?WSDL" |
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
@client.debug_dev=STDOUT |
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
[ | |
{ | |
"class1": "中央銀行", | |
"class2": null, | |
"class3": null, | |
"class4": null, | |
"code": "0000", | |
"name": "日本銀行", | |
"abbr": null, | |
"note": null |
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
$._data($0, "events"); |
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 'git-trend' | |
repos = GitTrend.get | |
json = repos.map { |repo| repo.to_h }.to_json | |
puts json |
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
SELECT CONCAT('kill ', id, ';') FROM information_schema.PROCESSLIST; |
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
function double_cp () { | |
f=$1 | |
bk=${1}_bk | |
tmp=${f}_xxxxxx | |
cp $f ${bk} | |
cat ${f}* > ${tmp} | |
rm -f ${bk} | |
rm -f $f | |
mv ${tmp} $f |
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 'benchmark/ips' | |
str = "aaabbbccc" | |
ar = ['aaa', 'ccc'] | |
Benchmark.ips do |x| | |
x.report('String#include?') do | |
str.include?('aaa') or str.include?('ccc') | |
end | |
x.report('Array#include?') do |
NewerOlder