Skip to content

Instantly share code, notes, and snippets.

View hirocaster's full-sized avatar

Hiroki OHTSUKA hirocaster

View GitHub Profile
$ cd ~/src/mozc/src
$ echo -e '(0 CreateSession)\n(1 SendKey 1 97)' | out_mac/Release/mozc_emacs_helper
((mozc-emacs-helper . t)(version . "1.13.1651.101")(config . ((preedit-method . roman))))
((emacs-event-id . 0)(emacs-session-id . 1)(output . ()))
((emacs-event-id . 1)(emacs-session-id . 1)(output . ((id . "9469176874988818267")(mode . hiragana)(consumed . t)(preedit . ((cursor . 1)(segment ((annotation . underline)(value . "あ")(value-length . 1)(key . "あ")))))(candidates . ((size . 1)(candidate ((index . 0)(value . "あ")(annotation . ((description . "ひらがな")))(id . 0)))(position . 0)(category . suggestion)(display-type . main)(footer . ((label . "Tabキーで選択")))))(status . ((activated . t)(mode . hiragana)(comeback-mode . hiragana)))(all-candidate-words . ((candidates ((id . 0)(index . 0)(value . "あ")(annotation . ((description . "ひらがな")))))(category . suggestion))))))
Index: build_mozc.py
===================================================================
--- build_mozc.py (revision 326)
+++ build_mozc.py (working copy)
@@ -214,6 +214,8 @@
# Include subdirectory of win32 and breakpad for Windows
if options.target_platform == 'Windows':
gyp_file_names.extend(glob.glob('%s/win32/*/*.gyp' % SRC_DIR))
+ elif options.target_platform == 'Mac':
+ gyp_file_names.extend(glob.glob('%s/unix/emacs/*.gyp' % SRC_DIR))
@hirocaster
hirocaster / sample_gist.rb
Last active November 8, 2022 08:35
Gistのサンプル
#! /usr/bin/env ruby
puts 'Hello Gist!'
@hirocaster
hirocaster / gist:5698361
Last active December 18, 2015 00:39
Install ruby by rbenv
rm /opt/boxen/rbenv/rbenv.d/install/00_try_to_download_ruby_version.bash
rbenv uninstall 1.9.3-p429
CONFIGURE_OPTS="--with-readline-dir=/opt/boxen/homebrew/opt/readline --with-openssl-dir=/opt/boxen/homebrew/opt/openssl" rbenv install 1.9.3-p429
rbenv uninstall 2.0.0-p195
RUBY_CONFIGURE_OPTS="--with-readline-dir=/opt/boxen/homebrew/opt/readline --with-openssl-dir=/opt/boxen/homebrew/opt/openssl" rbenv install 2.0.0-p195
@hirocaster
hirocaster / gist:2281082
Created April 2, 2012 05:46
MarsEdit Template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>#weblogName#: #title#</title>
<style type="text/css">
<!--
/*
* HTML5 Boilerplate
*
* What follows is the result of much research on cross-browser styling.
@hirocaster
hirocaster / gist:1939444
Created February 29, 2012 09:33
amazon.co.jp stock check script
# -*- coding: utf-8 -*-
require 'nokogiri'
require 'open-uri'
require 'kconv'
page = open "http://www.amazon.co.jp/exec/obidos/ASIN/4048860690/"
# page = open "http://www.amazon.co.jp/exec/obidos/ASIN/4774149942/"
html = Nokogiri::HTML(page.read, nil, 'Shift_JIS')
stock = html.search "//div[@class='buying']//span[@class='availGreen']"
@hirocaster
hirocaster / dns_check.rb
Created December 16, 2011 03:16
DNS check script
# -*- coding: utf-8 -*-
require 'resolv'
old = Resolv.getaddress("hiroki.jp").to_s
p old
begin
now = Resolv.getaddress("hiroki.jp").to_s
sleep(1)
p now
@hirocaster
hirocaster / gist:764477
Created January 4, 2011 06:43
Twitter_oauth.rb
require "rubygems"
require "oauth"
CONSUMER_KEY = 'XXXXXXXXXXXXXXXXXXXX'
CONSUMER_SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
@hirocaster
hirocaster / gist:734306
Created December 9, 2010 03:42
$SSH_AUTH_SOCK to Automatic Symbolic Link
agent="$HOME/.ssh-agent-$USER"
if [ -S "$SSH_AUTH_SOCK" ]; then
case $SSH_AUTH_SOCK in
/tmp/*/agent.[0-9]*)
ln -snf "$SSH_AUTH_SOCK" $agent && export SSH_AUTH_SOCK=$agent
esac
elif [ -S $agent ]; then
export SSH_AUTH_SOCK=$agent
else
echo "no ssh-agent"