This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8; -*- | |
# | |
# Author :: Masayuki Higashino | |
# | |
# This plugin looks up a word beside a caret or a selected text in | |
# Dictionary.app without changing activeness of Sublime Text 2.app's window. | |
# | |
# In order to use this plugin, Add a keymap such as a follow into user's key bindings. | |
# { "keys": ["super+d"], "command": "look_up_in_dictionary" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Description :: バックグラウンドで辞書.appで単語検索して、バックグラウンド | |
# でGoogle Chromeで英辞郎 on the Webで検索して、しまいには | |
# sayコマンドでしゃべってもらうスクリプト。 | |
# EmacsとかSublime Text 2とかから叩くと便利です。 | |
# Usage :: sh dict.sh "hello" | |
# Requiments :: Mac OS X, Gogle Chrome | |
# Note :: "Google Chrome"を"Safari"にしてexecute javascriptを | |
# do javascriptにすればSafariでも動くかもしれません。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/osascript | |
to join(array, delimiter) | |
set retVal to "" | |
set prevDelimiter to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to delimiter | |
set retVal to array as string | |
set AppleScript's text item delimiters to prevDelimiter | |
return retVal | |
end join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/ruby1.9 | |
# -*- coding: utf-8 -*- | |
# 指定したディレクトリ内のPDFの中から、 | |
# 1. 重複したファイル | |
# 2. Papers2のDBに登録済みのファイル | |
# をduplicated_filesへ移動します。 | |
# ファイルの同一性はMD5値で判定しています。 | |
# Usage :: $ papers-duplicate-checker.rb | |
# Author :: Masayuki Higashino |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /opt/local/bin/ruby1.9 | |
# This script prints the maximum, minimum, and average size of classes that are included in a specified jar file. | |
# | |
# Usage: ./this_script /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar | |
# Author: Masayuki Higashino | |
# License: Ruby | |
JAR_PATH = ARGV[0] | |
UNZIP_PATH = 'unzip' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Googleマップの中心地点から新しいウィンドウを開いてバス停検索スマホ版で中心地点付近のバス停を表示するブックマークレット。 | |
* @auther : Masayuki Higashino http://msyk.info/ | |
* @see バス停検索 http://buste.in/search/bus/ | |
* @see http://msyk.info/2013/11/18/bookmarklets-for-bustein-and-google-maps/ | |
* @license MIT License | |
*/ | |
javascript: (function() { | |
var lat = gApplication.getMap().getCenter().lat(); | |
var lng = gApplication.getMap().getCenter().lng(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* バス停検索のバス停留所の詳細情報のページから新しいウィンドウを開いてGoogleマップにピンを立てるブックマークレット。 | |
* @auther : Masayuki Higashino http://msyk.info/ | |
* @see バス停検索 http://buste.in/search/bus/ | |
* @see http://msyk.info/2013/11/18/bookmarklets-for-bustein-and-google-maps/ | |
* @license MIT License | |
*/ | |
javascript: (function() { | |
if (document.location.href.indexOf('http://buste.in/') >= 0 && location.href.indexOf('id') >= 0) { | |
var center = map.center.toUrlValue(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This scripts dump a tsv file of date vs. the number of gems' updates in a day from local 'quick/Marshal.4.8/*.gemspec' which gemspecs are downloaded from RubyGems.org. | |
# | |
# Author: Masayuki Higashino http://msyk.info/ | |
# License: Ruby | |
# See: http://msyk.info/2013/11/25/gems-updates-on-rubygems-org/ | |
require 'rubygems' | |
require 'rake' | |
ROOT_PATH = "db" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
def exec_command(command, replace_table={}) | |
replace_table.each{ |target, val| | |
command = command.gsub(target, val.gsub(/`/, '')) | |
} | |
Process.detach(spawn(command)) | |
end | |
raise if File.exists?('teokureta.txt') | |
exec_command('echo "#<<user>>: #<<post>>"', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |