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
module.exports = function (grunt) { | |
var pkg = grunt.file.readJSON('package.json'); | |
grunt.initConfig({ | |
jst: { | |
options: { | |
processName: function (filename) { | |
return filename.match(/templates\/(.+)\.tmpl$/)[1]; | |
}, | |
processContent: function (src) { | |
return src.replace(/(^\s+|\s+$)/gm, ''); |
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
module.exports = function (grunt) { | |
var pkg = grunt.file.readJSON('package.json'); | |
grunt.initConfig({ | |
concat: { | |
files: { | |
// 元ファイルの指定 | |
src : 'js/*.js', | |
// 出力ファイルの指定 | |
dest: 'js/concat/hogehoge.js' | |
} |
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
<snippet> | |
<content> | |
<![CDATA[<%- ${0:value} %>]]> | |
</content> | |
<tabTrigger>%-</tabTrigger> | |
<scope>text.html</scope> | |
<description>Underscore.js template with escape <%- %></description> | |
</snippet> |
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
@Test | |
public void somethingTest() { | |
DateTime mockDateTime= new DateTime(2014, 1, 1, 0, 0, 0); | |
DateTimeUtils.setCurrentMillisFixed(mockDateTime.getMills()); | |
// 現在日時を取得してみると、設定した日時が現在日時として取得される | |
System.out.println(new DateTime()); // 2014-01-01T00:00:00.000+09:00 | |
// something test code... | |
} |
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
/** | |
* <summary> | |
* 標準入力まわり | |
* </summary> */ | |
Console.ReadLine(); // 普通に読み込み | |
Console.ReadLine().split(''); // 任意の区切り文字 | |
Convert.ToInt16(Console.ReadLine()); // 数値を手に入れる時(Convertしちゃっていいんだっけ、要確認) |
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.Mediator.Model.Hoge = _.extend(Backbone.Model.prototype, { | |
title: 0, | |
name : 0, | |
// Viewは意図的に殺すので、監視ではなくViewがメソッドを呼ぶイメージ | |
changeTitle: function(title) { | |
this.title = title; | |
this.trigger('changedTitle'); | |
}, | |
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
var musicLists = _.chain(result.feed.entries) | |
.map(entry => { return entry.content.split('<br>') }) | |
.flatten() | |
.compact() | |
.filter(splited => { return /[<\/]/.test(splited) }) // 全角山括弧または半角スラッシュを含む文字列 | |
.value(); |
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
(function() { | |
/** | |
* Underscore.js(lodash.js)の独自拡張 | |
*/ | |
_.mixin({ | |
/** | |
* プロパティの値が空なプロパティを削除し、新たなオブジェクトを返却します。 | |
* | |
* @param {Object} o プロパティを持つオブジェクト | |
* @return {Object} 値が空なプロパティを削除した新たなオブジェクト |
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
var Collection = Backbone.collection.extend({ | |
model: Backbone.Model.extend({ idAttribute: 'cid' }); | |
}); | |
var collection = new Collection(attrs); |
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
(function() { | |
/** | |
* 値が null または空文字または未定義である | |
* @param v 検証対象値 | |
* @return 検証結果 | |
*/ | |
is.invalidValue = function(v) { | |
return is.null(v) || is.empty(v) || is.undefined(v); | |
}; | |
})(); |
OlderNewer