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
<?php
$url = 'https://downloads.wordpress.org/plugin/woocommerce.3.6.4.zip';
$tmpname = tempnam("/tmp", "kawarimi");
file_put_contents($tmpname, fopen($url, 'r'));
$zip = new ZipArchive;
$res = $zip->open($tmpname);
$zip->extractTo('./wp-content/plugins');
$zip->close();
exec('wp plugin activate woocommerce');
@harai
harai / setup-bootstrap.sh
Last active Sep 1, 2018
Ubuntu再インストール用bootstrap
View setup-bootstrap.sh
sudo apt install -y git
ssh-keygen -f ~/.ssh/id_rsa -t rsa
cat ~/.ssh/id_rsa.pub
# Add the pubkey to BitBucket/GitHub
# https://bitbucket.org/account/user/jharai/ssh-keys/
# https://github.com/settings/ssh
cd
git clone git@bitbucket.org:jharai/config.git Config
gedit Config/command &
@harai
harai / sort-firefox-containers.py
Created Apr 16, 2017
Sort Firefox container tab items
View sort-firefox-containers.py
#!/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
harai / script.sh
Last active Feb 13, 2017
Setting Up Build Environment of AWS Lambda
View script.sh
#!/bin/bash
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
harai / Font Changer for Kindle Cloud Reader
Last active Aug 15, 2016
A Greasemonkey script which changes the font family of Kindle Cloud Reader to sans-serif
View Font Changer for Kindle Cloud Reader
// ==UserScript==
// @name Font Changer for Kindle Cloud Reader
// @namespace https://github.com/harai/
// @include https://read.amazon.com/*
// @run-at document-start
// @version 1
// ==/UserScript==
if (!location.pathname.match(/KindleReaderApp.html$/)) {
return;
View gist:6699116
<?xml version="1.0"?>
<root>
<item>
<name>Key Bindings of Akihiro HARAI</name>
<identifier>private.akihiro_default</identifier>
<autogen>__KeyToKey__ KeyCode::I, ModifierFlag::COMMAND_L | ModifierFlag::OPTION_L | ModifierFlag::NONE, KeyCode::CURSOR_UP, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::J, ModifierFlag::COMMAND_L | ModifierFlag::OPTION_L | ModifierFlag::NONE, KeyCode::CURSOR_LEFT, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::K, ModifierFlag::COMMAND_L | ModifierFlag::OPTION_L | ModifierFlag::NONE, KeyCode::CURSOR_DOWN, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::L, ModifierFlag::COMMAND_L | ModifierFlag::OPTION_L | ModifierFlag::NONE, KeyCode::CURSOR_RIGHT, ModifierFlag::OPTION_L</autogen>
@harai
harai / Mapsだけは日本語で! for Google Maps™ Greasemonkey Script
Last active Dec 23, 2015
Mapsだけは日本語で! for Google Maps™ Greasemonkey Script
View Mapsだけは日本語で! for Google Maps™ Greasemonkey Script
// ==UserScript==
// @name Mapsだけは日本語で! for Google Maps™
// @namespace https://github.com/harai/
// @include https://www.google.co.jp/maps*
// @include http://www.google.co.jp/maps*
// @include https://www.google.com/maps*
// @include http://www.google.com/maps*
// @include https://maps.google.co.jp/*
// @include http://maps.google.co.jp/*
// @include https://maps.google.com/*
@harai
harai / .mayu
Created Jun 28, 2013
mayu for linux Dvorak on MacBook key binding
View .mayu
include "109.mayu"
# mac key def
def key MacEisuu = 0x7b
def key MacKana = 0x7a
# Dvorak1
def subst *Minus = *Atmark
def subst *CircumflexAccent = *LeftSquareBracket
View order before and after tsort
before tsort: [[nil]]-> [[:load_environment_hook]] ->[[nil]]
before tsort: [[:load_environment_hook]]-> [[:load_active_support]] ->[[nil]]
before tsort: [[:load_active_support]]-> [[:preload_frameworks]] ->[[nil]]
before tsort: [[:preload_frameworks]]-> [[:initialize_logger]] ->[[nil]]
before tsort: [[:initialize_logger]]-> [[:initialize_cache]] ->[[nil]]
before tsort: [[:initialize_cache]]-> [[:initialize_dependency_mechanism]] ->[[nil]]
before tsort: [[:initialize_dependency_mechanism]]-> [[:bootstrap_hook]] ->[[nil]]
before tsort: [[nil]]-> [["i18n.callbacks"]] ->[[nil]]
before tsort: [[nil]]-> [["active_support.initialize_whiny_nils"]] ->[[nil]]
before tsort: [["active_support.initialize_whiny_nils"]]-> [["active_support.deprecation_behavior"]] ->[[nil]]
@harai
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 https://inbox.google.com/*
// @version 1
// @grant none
// ==/UserScript==
setInterval(function() {
You can’t perform that action at this time.