- Ruby 3.1 (
ruby:3.1
docker image) - unicorn 6.1
- Rails 6.1
- Run unicorn with 4 worker processes
- Request 100 times to unicorn app
$(window).on("scroll", function() { | |
var scrollHeight = $(document).height(); | |
var scrollPosition = $(window).height() + $(window).scrollTop(); | |
if ((scrollHeight - scrollPosition) / scrollHeight === 0) { | |
// when scroll to bottom of the page | |
} | |
}); |
$('.info').on('click', function(){ | |
$('html, body').animate({ | |
scrollTop: $(this).offset().top | |
}, 500); | |
}); |
<?php | |
function checktime($hour, $min, $sec) { | |
if ($hour < 0 || $hour > 23 || !is_numeric($hour)) { | |
return false; | |
} | |
if ($min < 0 || $min > 59 || !is_numeric($min)) { | |
return false; | |
} | |
if ($sec < 0 || $sec > 59 || !is_numeric($sec)) { | |
return false; |
#!/bin/bash | |
set -x | |
set -e | |
export DEBIAN_FRONTEND=noninteractive | |
curl -LO https://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb | |
echo mysql-apt-config mysql-apt-config/select-product select Apply | sudo debconf-set-selections | |
echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections | |
echo mysql-apt-config mysql-apt-config/select-connector-python select none | sudo debconf-set-selections |
$.ajax({ | |
url: "ajax.html", | |
success: function(data) { | |
alert('success!!'); | |
}, | |
error: function(data) { | |
alert('error!!!'); | |
} | |
}); |
<?php | |
$PREFECTURE = [ | |
'1' => '北海道', | |
'2' => '青森県', | |
'3' => '岩手県', | |
'4' => '宮城県', | |
'5' => '秋田県', | |
'6' => '山形県', | |
'7' => '福島県', | |
'8' => '茨城県', |
* level-3
def a | |
doc = <<-EOS | |
def hello | |
puts "Hello World!" | |
end | |
EOS | |
end |
require 'benchmark/ips' | |
Benchmark.ips do |x| | |
ary = [] | |
x.report(:a) { | |
10_000.times do |num| | |
ary << "#{num} #{num * 2} #{num * 3}" | |
end | |
} |