Skip to content

Instantly share code, notes, and snippets.

View yoshinari-nomura's full-sized avatar

Yoshinari Nomura yoshinari-nomura

View GitHub Profile
@yoshinari-nomura
yoshinari-nomura / calfw-mhc.el
Created September 23, 2011 04:39
calfw-mhc: 2011-09-23
;;; calfw-mhc.el --- calfw calendar view for mhc
;; Author: Yoshinari Nomura <[email protected]>
;;; Commentary:
;; setting example:
;;
;; (require 'calfw)
;; (require 'calfw-mhc)
@yoshinari-nomura
yoshinari-nomura / .zaliases
Created September 27, 2011 06:30
Small aliases to get along with Emacs buffer.
## Invoke the ``dired'' of current working directory in Emacs buffer.
function dired () {
emacsclient -e "(dired \"$PWD\")"
}
## Chdir to the ``default-directory'' of currently opened in Emacs buffer.
function cde () {
EMACS_CWD=`emacsclient -e "
(expand-file-name
(with-current-buffer
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# Please add INDEX to speedup the SQL queries which use LIKE clauses:
#
# sqlite3 "#{DICT_FILE}" 'CREATE INDEX dict_key ON dict (key COLLATE NOCASE);'
SQLITE = "sqlite3"
DICT_FILE = "'#{ENV['HOME']}/sys/lib/Dic/EDP/mouseoverdictionary.sqlite'"
(add-private-load-path "auto-complete")
(require 'popup)
(defun dic-at-point ()
(interactive)
(let* ((word (word-at-point))
(desc (and word (shell-command-to-string (format "dic '%s'" word)))))
(when (and desc (null popup-instances))
(popup-tip desc :margin t))))
@yoshinari-nomura
yoshinari-nomura / gist:3465571
Created August 25, 2012 13:20
Font setup for Cocoa Emacs24
(when (and (>= emacs-major-version 24)
(eq window-system 'ns))
;; フォントセットを作る
(let* ((fontset-name "myfonts") ; フォントセットの名前
(size 14) ; ASCIIフォントのサイズ [9/10/12/14/15/17/19/20/...]
(asciifont "Menlo") ; ASCIIフォント
(jpfont "Hiragino Maru Gothic ProN") ; 日本語フォント
(font (format "%s-%d:weight=normal:slant=normal" asciifont size))
(fontspec (font-spec :family asciifont))
(jp-fontspec (font-spec :family jpfont))
@yoshinari-nomura
yoshinari-nomura / Makefile
Created January 17, 2013 03:19
My Makefile template for TeX documents.
###
### Makefile for LaTeX documents
###
### Yoshinari Nomura
###
### GNU make 3.81 will work for you.
###
#####################################################################
# Typeset commands and path settings
@yoshinari-nomura
yoshinari-nomura / paper-sample-for-latex-makefile.tex
Created February 1, 2013 03:59
Sample TeX file for my Makefile Template.
\documentclass[10pt, conference, compsocconf]{IEEEtran}
\usepackage[dvipdfm]{graphicx}
\begin{document}
\title{Writing papers}
\author{\IEEEauthorblockN{
Taro Momo,
Saru Kiji,
and
Aka Oni}
#!/bin/bash
BOT_ID="nomnichi_bot"
ROOM="nomlab"
SECRET="XXXXXXXXXXXXXXXXXXXXXXXXXXX"
BASE_URL='http://lingr.com/api/room/say'
bot_verifier=`echo -n "$BOT_ID$SECRET" | openssl dgst -sha1 | sed 's/^.* //'`
URL="$BASE_URL?room=$ROOM&bot=$BOT_ID&bot_verifier=$bot_verifier"
#!/bin/sh
CMD_NAME=`basename $0`
OLD_MHC_TOP_DIR="${1%/}" # remove trailing slash
NEW_MHC_TOP_DIR="${2%/}" # remove trailing slash
LOG_FILE="$NEW_MHC_TOP_DIR/$CMD_NAME$$.log"
usage() {
echo "Usage: $CMD_NAME <top-dir> <new-top-dir>"
echo " $CMD_NAME copies old mhc files from <top-dir> into"
@yoshinari-nomura
yoshinari-nomura / caldav-delete-all
Created May 9, 2014 05:14
Remove all calendar evens from Google calendar using mhc
#!/usr/bin/env ruby
# Usage: caldav-delete-all <calendarname>
#
# <calendarname>: calendar name found in ~/.mhc/config.yml
if File.symlink?(__FILE__) and ENV["RBENV_VERSION"]
ENV["RBENV_VERSION"] = nil
shims_path = File.expand_path("shims", ENV["RBENV_ROOT"])
ENV["PATH"] = shims_path + ":" + ENV["PATH"]