Skip to content

Instantly share code, notes, and snippets.

View mh61503891's full-sized avatar
🍣

Masayuki Higashino mh61503891

🍣
View GitHub Profile
@mh61503891
mh61503891 / LookUpInDictionary.py
Created November 23, 2012 21:34
Sublime Text 2's plugin that looks up a word beside a caret or a selected text in Dictionary.app.
# -*- 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" }
@mh61503891
mh61503891 / dict.sh
Created November 24, 2012 18:26
辞書.appとEOWをバックグラウンドで字引きしてついでに喋ってくれるスクリプト。
#!/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でも動くかもしれません。
@mh61503891
mh61503891 / iTunes'CurrentStreamInfoToEvernote.applescript
Created December 8, 2012 15:49
iTunesで現在再生している曲のタイトルとURLを日付と共にEvernoteのノートに書き込むスクリプト
#!/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
#!/opt/local/bin/ruby1.9
# -*- coding: utf-8 -*-
# 指定したディレクトリ内のPDFの中から、
# 1. 重複したファイル
# 2. Papers2のDBに登録済みのファイル
# をduplicated_filesへ移動します。
# ファイルの同一性はMD5値で判定しています。
# Usage :: $ papers-duplicate-checker.rb
# Author :: Masayuki Higashino
@mh61503891
mh61503891 / gist:6198984
Last active December 20, 2015 21:39
This script prints the maximum, minimum, and average size of classes that are included in a specified jar file.
#! /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'
/**
* 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();
/**
* バス停検索のバス停留所の詳細情報のページから新しいウィンドウを開いて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();
@mh61503891
mh61503891 / gemspecs_to_tsv_of_date_vs_all_versions.rb
Last active December 29, 2015 06:29
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.
# 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"
# -*- 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>>"', {
@mh61503891
mh61503891 / 0_reuse_code.js
Created November 27, 2013 16:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console