Skip to content

Instantly share code, notes, and snippets.

View bootjp's full-sized avatar
🏠
Working from home

Yoshiaki Ueda (bootjp) bootjp

🏠
Working from home
View GitHub Profile
<!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>
<!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;
@bootjp
bootjp / curl.sh
Created March 21, 2016 12:10
Web Server Travel Shooting for header
while true; do sleep 3; curl --head -Ss https://bootjp.me/ | head -n 1 ;done
@bootjp
bootjp / curl.sh
Last active October 29, 2017 03:37
Web Server Trouble Shooting By Responsetime
while true; do sleep 3; curl -o /dev/null -sw %{time_total}\\n https://bootjp.me/ ;done
@bootjp
bootjp / gist:83626973f7674e28f1ef29a250ea0b6e
Created October 7, 2016 13:31
Linuxカーネルのチューニング

設定内容

# vim /etc/sysctl.conf
# 共有メモリの最大サイズ。サーバーの搭載メモリ(1GB)に合わせて変更
kernel.shmmax      = 1073741824
@bootjp
bootjp / wp_ad_switch.js
Last active January 21, 2017 11:48
my wordpress ad switch javascript
(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;
}
}
# 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
@bootjp
bootjp / append_noopener.js
Last active March 18, 2017 00:29
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';
}
});
@bootjp
bootjp / 0_reuse_code.js
Created September 20, 2017 06:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bootjp
bootjp / bench.kt
Created November 15, 2017 04:07
Kotlin benchmark String.format vs String.replace
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))