Skip to content

Instantly share code, notes, and snippets.

View shimotori's full-sized avatar

Shimotori shimotori

View GitHub Profile

Sublime Textの検索窓に日本語を入力するとEnterを押すなり文字が消えてしまうのですが、無理やり解決する方法を見つけました。ググってもこちらのバグレポートしか見つからなかったので報告です。

わたしの環境はMac OS XのSublime Text 3 (Build 3059)ですが、この解決方法はSublime Text 2 (Build 2220)にも対応しています。Windowsの場合は不明です。

ステップ1: Sublime Text 3の場合のみ: Default (OSX).sublime-keymapを編集可能にする

このステップはSublime Text 3の場合のみ必要です。Sublime Text 2の場合はステップ2に行って下さい。

/**
* Japanese locale file for Sencha Touch 2
* File: ext-lang-ja.js
* Auther: sunvisor/Xenophy (hisashi.nakamura@xenophy.com)
* history: 2012-09-15 Prototype Version (test is not completed)
**/
Ext.onReady(function() {
var cm = Ext.ClassManager,
exists = Ext.Function.bind(cm.get, cm);
@shimotori
shimotori / _styles.scss
Created April 6, 2013 10:48
Octopressで記事のタイトルの日付を更新日時にする(_styles.scss)
// sass/custom/_styles.scss
article {
header {
p.meta {
position: static;
}
}
}
@shimotori
shimotori / article.html
Created April 6, 2013 10:47
Octopressで記事のタイトルの日付を更新日時にする(article.html)
<!-- source/_includes/article.html -->
{% include post/date.html %}
{% if updated %}{{ updated }}{% else %}{{ time }}{% endif %}
@shimotori
shimotori / gist:2998735
Created June 26, 2012 20:32
ActiveRecordモデルのデータをMongoidモデルに変換
# ARモデルに追加
# Mongoid向けのハッシュを生成
def gen_hash_for_mongoid
hash = {}
self.attributes.each_pair do |k1, v|
k2 = k1 + ((k1.match(/^id$/) || k1.match(/_id$/)) ? '_ar' : '') # PK, FKには後ろに_arを付ける
hash[k2] = v
end
hash
end
@shimotori
shimotori / mongoid_json.rb
Created June 21, 2012 00:50
MongoidモデルのJSON形式にidフィールドが含まれるようにする
module MongoidJson
# JSONの形式をカスタマイズ(idが含まれるようにする)
def as_json(options={})
json = super(options)
json['id'] = self.persisted? ? self._id : nil
json
end
end
@shimotori
shimotori / jasmine.yml
Created March 31, 2012 21:38
jasmine-railsでのjasmine.ymlのサンプル
# src_files
#
# Return an array of filepaths relative to src_dir to include before jasmine specs.
# Default: []
#
# EXAMPLE:
#
# src_files:
# - lib/source1.js
# - lib/source2.js
@shimotori
shimotori / sample.html.haml
Created March 10, 2012 00:25
jQuery UI Layoutプラグインのサンプル
#sample.ui-layout-container(style="width:500px; height:300px;")
.ui-layout-west
%p west
%p west
%p west
%p west
%p west
.ui-layout-center
%p center
%p center
@shimotori
shimotori / gist:1973313
Created March 4, 2012 14:43
[CoffeeScript] グローバル変数用オブジェクトの定義 (WebブラウザとNode.jsの両環境用)
root = exports ? this
@shimotori
shimotori / bigint_pk.rb
Created February 25, 2012 05:35
[Rails] Make the primary key BIGINT UNSIGNED
require 'active_record/connection_adapters/mysql2_adapter'
ActiveRecord::ConnectionAdapters::Mysql2Adapter::NATIVE_DATABASE_TYPES[:primary_key] = "BIGINT UNSIGNED DEFAULT NULL auto_increment PRIMARY KEY"
# For Rails 3.2
# Place this file in Configuration/initializers
#
# Based on:
# http://stackoverflow.com/questions/1066340/how-to-use-long-id-in-rails-applications
#
# Core: