Skip to content

Instantly share code, notes, and snippets.

# 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'
@rochefort
rochefort / rails_git_log.sh
Last active October 28, 2023 09:19
kaigi on rails 2023 by zaak
timeago() {
if [ -n "$1" ]
then
gdate +"%Y-%m-%d" -d "$1 ago"
else
gdate +"%Y-%m-%d" -d "$1 week ago"
fi
}
summary() {
#!/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"
@rochefort
rochefort / request.rb
Last active August 24, 2018 07:00
garoon-cat-0.2.1/lib/garoon-cat/request.rb
@client.debug_dev=STDOUT
@rochefort
rochefort / japanese_banks.json
Last active December 29, 2017 18:44
Japanese Banks
[
{
"class1": "中央銀行",
"class2": null,
"class3": null,
"class4": null,
"code": "0000",
"name": "日本銀行",
"abbr": null,
"note": null
@rochefort
rochefort / show_jquery_function
Last active November 7, 2017 06:56
Show jQuery Function
$._data($0, "events");
@rochefort
rochefort / git-trend_json_new_example.rb
Last active July 22, 2017 14:41
git-trend json example
require 'git-trend'
repos = GitTrend.get
json = repos.map { |repo| repo.to_h }.to_json
puts json
@rochefort
rochefort / gist:c88ee0c9ec37c710b48c8883293e4798
Created July 6, 2017 02:38
generate sqls to kill all mysql processes
SELECT CONCAT('kill ', id, ';') FROM information_schema.PROCESSLIST;
@rochefort
rochefort / double_cp.sh
Created February 1, 2017 08:36
double cp
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
@rochefort
rochefort / include_or_match.rb
Last active June 13, 2016 09:54
regexp is slow?
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