Skip to content

Instantly share code, notes, and snippets.

@oti
oti / _r-sprite.scss
Created August 13, 2015 09:29
spritesmith retina sprite mixin
// http://blog.webcreativepark.net/2014/04/06-190024.html
// @include sprite($a);
@mixin r-sprite-width($sprite) {
width: nth($sprite, 5)/2;
}
@mixin r-sprite-height($sprite) {
height: nth($sprite, 6)/2;
}
@oti
oti / ua_detecter.js
Last active August 29, 2015 14:24
ua_detecter
var _ua = (function(u){
return {
ltIE6:typeof window.addEventListener == "undefined" && typeof document.documentElement.style.maxHeight == "undefined",
ltIE7:typeof window.addEventListener == "undefined" && typeof document.querySelectorAll == "undefined",
ltIE8:typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined",
ltIE9:document.uniqueID && typeof window.matchMedia == "undefined",
gtIE10:document.uniqueID && window.matchMedia,
gtIE11:document.uniqueID && document.documentMode >= 11,
Trident:document.uniqueID,
Gecko:'MozAppearance' in document.documentElement.style,
プロパティー 発音
background-attachment バックグラウンド・アタッチメント
background-color バックグラウンド・カラー
background-image バックグラウンド・イメージ
background-position バックグラウンド・ポジション
background-repeat バックグラウンド・リピート
background バックグラウンド
border-collapse ボーダー・コラプス
border-color ボーダー・カラー
@oti
oti / commandReady.sh
Created June 9, 2015 09:28
commandReady.sh
#!/bin/sh
which AwesomeCommand
commandReady=$?
if [ "commandReady" = 0 ]; then
echo "AwesomeCommand is ready."
else
echo "AwesomeCommand is not ready."
fi
@oti
oti / evenizer.sh
Created June 9, 2015 05:39
evenizer
#!/bin/sh
# 奇数ピクセルの画像でスプライト画像を生成するとretinaでズレるのでこれで偶数化する
# https://github.com/katapad/evenizer
#
# $ npm i -g evenizer
for file in `find . -name '*.png'`; do
evenizer -i ${file}
done
@oti
oti / TRBL Method
Created December 25, 2014 14:03
absolute centering style
E{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
width: XXX;
height: YYY;
}