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(global) { | |
var doc = global.document; | |
var deviceRatio = global.innerWidth / 320; | |
doc.documentElement.style.zoom = deviceRatio; | |
}(this.self || global)); |
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
<script src="http://cdnjs.cloudflare.com/ajax/libs/vue/0.8.8/vue.min.js"></script> | |
<ul id="list"> | |
<li v-repeat="monsters"> | |
{{name}} | |
<div v-repeat="types">タイプ{{$index + 1}}: {{$value}}</div> | |
<ul> | |
<li v-repeat="baseStats">{{$root.lang[$key]}}: {{$value}}</li> | |
</ul> | |
</li> | |
</ul> |
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
Vue.directive('tap', { | |
isFn: true, | |
bind: function () { | |
this.el = $(this.el); | |
}, | |
update: function (fn) { | |
var vm = this.vm; | |
this.handler = function (e) { | |
e.targetVM = vm; |
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
# For Compass v0.13 | |
# See also http://stackoverflow.com/questions/16793278/generate-sprites-with-compass-with-smart-layout-and-spacing | |
module Compass | |
module SassExtensions | |
module Sprites | |
module Layout | |
class Smart < SpriteLayout | |
def layout! | |
calculate_positions! |
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 | |
# Add branch name to top of commit msg. | |
# Save this as: .git/hooks/prepare-commit-msg | |
# And then: chmod +x .git/hooks/prepare-commit-msg | |
###################################################### | |
BRANCH=$(git branch | grep '*' | sed 's/* //') | |
( | |
mv $1 $1.BAK; | |
/bin/echo -n "#[${BRANCH}] " >$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
(function(global, $, undefined) { | |
'use strict'; | |
var doc = global.document; | |
// まずイベント名を確定させる | |
var TRANSITION_END = (function() { | |
var events = { | |
'transition': 'transitionend', | |
'WebkitTransition': 'webkitTransitionEnd' |
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
/** | |
* TypeWriter的な動きを実装するスニペット | |
* 気になる点としては、不完全な文字(<s とかタグの途中とか)をそのままHTMLとしてDOMに突っ込むので、 | |
* うまく解釈してくれないやつがいたらバグりそう | |
*/ | |
var str = "<p>This is my <span style='color:red;'>special string</span> with <br><br>an <img src='http://placehold.it/150x150'> image !</p>", | |
i = 0, | |
isTag, | |
dest = document.getElementById('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
{ | |
"adjoining-classes": false, | |
"box-model": false, | |
"box-sizing": false, | |
"compatible-vendor-prefixes": false, | |
"empty-rules": false, | |
"fallback-colors": false, | |
"font-sizes": false, | |
"gradients": false, | |
"important": false, |
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
# --------------------------------------------------------------------- | |
# 奇数サイズの画像があればコミットできないようにするフック | |
# | |
# git_hooks pre-commmitとして設定 | |
# --------------------------------------------------------------------- | |
#!/bin/sh | |
cmd=`find /path/to/img/dir -name '*.png' | xargs file | awk '{ if ($5%2 || $7%2) print $1 }'` | |
if [[ -n $cmd ]]; then | |
echo '以下の画像のサイズが奇数になってるのでコミットできません' |
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 Eve = function() { | |
this._events = {}; | |
}; | |
Eve.prototype = { | |
constructor: Eve, | |
on: function(evName, handler) { | |
var events = this._events; | |
if (!(evName in events)) { | |
events[evName] = []; |
OlderNewer