Skip to content

Instantly share code, notes, and snippets.

;; browse-url.el からコピペ
;; open コマンドに --background オプション付ける
(defun browse-url-default-macosx-browser (url &optional new-window)
(interactive (browse-url-interactive-arg "URL: "))
(start-process (concat "open" url) nil "open" "--background" url))
;;; pit.el --- Manipulate pit data.
;; Copyright (C) 2008 Takeru Naito
;; Author: Takeru Naito <takeru.naito@gmail.com>
;; Original: cho45 http://lowreal.rubyforge.org/pit/
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published
;; by the Free Software Foundation; either version 2, or (at your
;; option) any later version.
@ymt2
ymt2 / userscript.js
Created December 12, 2012 17:52
Doc notification on ChatWork app with Fluid
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
function updateDockBadge() {
var newBadge = '';
var totalCount = 0;
var roomsRoot = document.getElementById('cw_roomlist_items');
var ur_elms = roomsRoot.getElementsByClassName('cw_unread');
@ymt2
ymt2 / check_php_error.py
Last active October 13, 2015 10:18
[githook][python]phpのシンタックスチェック
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import subprocess
def get_index_files(extensions=[]):
"""gitリポジトリ path の INDEX に追加されているファイル名一覧を返す
@ymt2
ymt2 / wrapNkf.sh
Last active October 8, 2015 03:28
text encoding
# @todo オプションは連想配列で持つ
function wrapNkf() {
if [ $# -eq 2 ]; then
local TMP_FILENAME='/tmp/wrapNkf.'$$
if [ $1 = 'euc' ]; then
local NKF_OPTION='-e -Lu'
elif [ $1 = 'sjis' ]; then
local NKF_OPTION='-s -Lw'
elif [ $1 = 'utf8' ]; then
@ymt2
ymt2 / change_directory_bookmarks.sh
Last active October 8, 2015 02:17
zsh: directory bookmarks
## directory bookmarks
DB_HISTORY=~/.directory_bookmarks
function _cdb_list() {
local I=1
while read LINE;
do
printf "%2d %s\n" ${I} ${LINE}
((I++))
done < $DB_HISTORY
unset LINE
@ymt2
ymt2 / search.sh
Last active October 8, 2015 02:17
zsh: fulltext search
function search() {
if [ $# = 0 ]; then echo 'usage: search [path] text'; return; fi
local d="."
local w=$1
if [ $# = 2 ]; then d=$1; w=$2; fi
find "$d" -print0 | xargs -0 grep -nE "$w"
}
alias s='search'
@ymt2
ymt2 / gist:1875978
Created February 21, 2012 11:25 — forked from uneco/gist:1333025
文字数が同じで意味が反対の英単語
slow 遅い
fast 速い
above より上に
below より下に
absolute 絶対的な
relative 相対的な
abstract 抽象的な