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 -o /dev/null -sw %{time_total}\\n https://bootjp.me/ ;done
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>
View gist:d7634e9792b802825a77

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

View docker-machin_init.sh
$ docker-machine create -d virtualbox \
# --engine-insecure-registry oreore.repo.bootjp.me:5000 \
docker-machine-vm # enter (return)
## 出力
> docker-machine-vm
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...
To see how to connect Docker to this machine, run: docker-machine env docker-machine-vm