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
<input type="text" name="hoge" pattern="abc"> |
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
$.Deferred().pipe(function () { | |
// なんらかの処理 | |
// ajaxとかanimateとかdeferredとかのpromiseしたjQueryオブジェクトを返す。 | |
// (※それらの処理がresolveされた時点で次のpipeに登録した関数が実行される) | |
return promised; | |
}).pipe(function () { | |
// なんらかの処理 | |
// ajaxとかanimateとかdeferredとかのpromiseしたjQueryオブジェクトを返す。 | |
// (※それらの処理がresolveされた時点で次のpipeに登録した関数が実行される) | |
return promised; |
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
// ECMA5から使えるforEachメソッドとはvalueとindexの引数の順番が逆 | |
[1, 2, 3].forEach(function (value, index, context) { | |
// loop | |
}); |
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 w = window, | |
d = w.document, | |
dE = d.documentElement, | |
unavailableQuerySelector = isUndefined(d.querySelector), | |
unavailablePerformance = isUndefined(w.performance), | |
isIE = !isUndefined(d.uniqueID), | |
ltIE6 = isIE && isUndefined(dE.style.maxHeight), | |
ltIE7 = isIE && unavailableQuerySelector, | |
ltIE8 = isIE && isUndefined (d.getElementsByClassName), | |
ltIE9 = isIE && isUndefined(w.Worker), |
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 Support = (function (w) { | |
var d = w.document, | |
dE = d.documentElement, | |
notIn = function (property) { | |
return property === void 0; | |
}, | |
disavailableAddEventListener = notIn(w.addEventListener); | |
availablePosStyle = !notIn(dE.style.posTop); | |
isTouchable = !notIn(w.ontouchstart) || !!w.navigator.msPointerEnabled; |
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
# 画像の情報 | |
imgWidth = $img.width() | |
imgHeight = $img.height() | |
imgAspectRatio = containerWidth / containerHeight | |
# コンテナの情報 | |
containerWidth = $container.width() | |
containerHeight = $container.height() | |
containerAspectRatio = containerWidth / containerHeight | |
# 画像の拡縮率の算出 | |
# アス比が1以上なら横長/1以下なら縦長 |
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
# nodeやenvのPATHを通しておく | |
PATH=/usr/local/bin:/bin:/usr/bin:$PATH | |
export PATH | |
for f in "$@" | |
do | |
dir=`dirname "$f"` | |
file=`basename "$f"` | |
name=`basename "$f" .js` | |
cd $dir |
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
selector { | |
/* 画像パス スライス リピート の順であれば安全 */ | |
border-image: url(hoge.png) 1 1 1 1 stretch; | |
/* ボーダーの太さは別に記述する */ | |
border-width: 5px 5px 5px 5px; | |
} |
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
# model | |
class Hoge extends Backbone.Model | |
constuctor: -> | |
super | |
@set fuga: 'fuga' | |
# View | |
class HogeView extends Backbone.View | |
constuctor: -> | |
@model = new Hoge |
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
do (w = @, $ = @jQuery) -> | |
# GitBoxTest | |
$('#hoge').on 'click', -> | |
$(@).next('.fuga').slideToggle 200, 'linear', -> | |
console?.log? 'slide' |
OlderNewer