Skip to content

Instantly share code, notes, and snippets.

Harai Akihiro harai

Block or report user

Report or block harai

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View demofile.php
$url = '';
$tmpname = tempnam("/tmp", "kawarimi");
file_put_contents($tmpname, fopen($url, 'r'));
$zip = new ZipArchive;
$res = $zip->open($tmpname);
exec('wp plugin activate woocommerce');
harai /
Created Apr 16, 2017
Sort Firefox container tab items
#!/usr/bin/env python3
import json
import glob
from os import path
def get_jsonpath():
homedir = path.expanduser('~')
profiledirs = glob.glob('{}/.mozilla/firefox/*.default'.format(homedir))
harai /
Last active Feb 13, 2017
Setting Up Build Environment of AWS Lambda
set -e -x
yum -y update
yum -y upgrade
yum -y groupinstall "Development Tools"
yum -y install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel git
export HOME=/home/ec2-user
harai /
Last active Sep 1, 2018
sudo apt install -y git
ssh-keygen -f ~/.ssh/id_rsa -t rsa
cat ~/.ssh/
# Add the pubkey to BitBucket/GitHub
git clone Config
gedit Config/command &
harai / inbox-title-patch.user.js
Created Nov 24, 2015
Title patch for Inbox by Gmail™
View inbox-title-patch.user.js
// ==UserScript==
// @name Title patch for Inbox by Gmail™
// @namespace com.github.harai
// @description Count unread messages and display it as the page's title.
// @include*
// @version 1
// @grant none
// ==/UserScript==
setInterval(function() {
harai / Dockerfile
Created Nov 5, 2015
Dockerfile which starts Google Chrome
View Dockerfile
FROM ubuntu:14.04
# Usage:
# docker build -t chrome .
# docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix chrome
# Created originally by:
harai / gigasort.rb
Created Jun 20, 2015
View gigasort.rb
require 'securerandom'
def find_smallest_pair(path)
files = Dir["#{path}/*"].sort_by do |f|
if files.size < 2
harai / backlog2md.user.js
Last active Aug 29, 2015
Convert Backlog™ notation to Markdown.
View backlog2md.user.js
// ==UserScript==
// @name Backlog™2Markdown
// @namespace
// @description Convert Backlog™ notation to Markdown.
// @include https://**
// @version 1.0.1
// ==/UserScript==
// Copyright (C) 2015 Akihiro HARAI
// Originally created by edvakf
View crontab
harai / gist:91c87437b18331e51a23
Last active Aug 29, 2015
ライフチェンジングなpercolとautojumpの紹介 - 404 Engineer Logs のUbuntu 14.04対応版
View gist:91c87437b18331e51a23
function exists { which $1 &> /dev/null }
if exists percol; then
function percol_select_history() {
local tac
BUFFER=$(history | sed -e "s/^\\s*[0-9]*\\s*\\*\?\\s*//g" | tac | percol --query "$LBUFFER")
CURSOR=$#BUFFER # move cursor
zle -R -c # refresh
You can’t perform that action at this time.