Skip to content

Instantly share code, notes, and snippets.

Harai Akihiro harai

View GitHub Profile
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
View gist:9049959
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.11.0-15-generic", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /home/jharai/.m2/settings.xml
[DEBUG] Using local repository at /home/jharai/.m2/repository
You can’t perform that action at this time.