View bench.kt
import org.apache.commons.lang.RandomStringUtils
import java.util.*
fun main(args: Array<String>) {
val tryCount = 1000000
val formatStart = Date()
for (i in 1..tryCount) {
var string = "%s%s%s"
string += RandomStringUtils.randomAlphabetic(10)
val aa = string.format(RandomStringUtils.randomAlphabetic(3), RandomStringUtils.randomAlphabetic(3), RandomStringUtils.randomAlphabetic(3))
View curl.sh
while true; do sleep 3; curl -o /dev/null -sw %{time_total}\\n https://bootjp.me/ ;done
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View append_noopener.js
Array.prototype.slice.call(document.getElementsByTagName('a')).forEach(function(element) {
if (element.target === '_blank' && element.rel.indexOf('noopener') === -1) {
element.rel += ' noopener';
}
});
View display_error_code.sh
# this file added ~/.bashrc
# fork from http://qiita.com/takayuki206/items/f4d0dbb45e5ee2ee698e
function __show_exit_code() {
local status=$(echo ${PIPESTATUS[@]})
local SETCOLOR_FAILURE="echo -en \\033[1;31m"
local SETCOLOR_NORMAL="echo -en \\033[0;39m"
for s in ${status}
do
if [ ${s} -ne 0 ]; then
View wp_ad_switch.js
(function() {
var metas = document.getElementsByTagName('head')[0].getElementsByTagName('meta');
for (var index = 0; index < metas.length; index++) {
if (metas[index].name === 'keywords' && metas[index].content.indexOf('技術系') !== -1) {
console.log('技術記事');
break;
}
}
View gist:83626973f7674e28f1ef29a250ea0b6e

設定内容

# vim /etc/sysctl.conf
# 共有メモリの最大サイズ。サーバーの搭載メモリ(1GB)に合わせて変更
kernel.shmmax      = 1073741824
View curl.sh
while true; do sleep 3; curl --head -Ss https://bootjp.me/ | head -n 1 ;done
View test.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>iOS9 And iPhone6Plus fixed element displayed tab bar is click event not working</title>
</head>
<body>
<style>
.fixed {
position: fixed;
View sample.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>iOS9 fixed element delay bug?</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
<body>
<p>scroll pages!!</p>
<div class="sample_element" style="position: fixed;top: 30px;">this is fixed</div>
<div class="sample_element" style="position: absolute;color: #333; top: 250px;">this is absolute</div>