Skip to content

Instantly share code, notes, and snippets.

@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;
}
@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 / 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
プロパティー 発音
background-attachment バックグラウンド・アタッチメント
background-color バックグラウンド・カラー
background-image バックグラウンド・イメージ
background-position バックグラウンド・ポジション
background-repeat バックグラウンド・リピート
background バックグラウンド
border-collapse ボーダー・コラプス
border-color ボーダー・カラー
@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,
@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 / sp-version.js
Last active September 24, 2015 12:01
sp-version.js
var ua = navigator.userAgent.toLowerCase();
var device = {};
function _getVersion(ua, token, delimiter) {
var verArr = ua.split(token)[1].trim().split(/[^\w\.]/)[0].split(delimiter)
return {
major: parseInt(verArr[0], 10) || 0,
minor: parseInt(verArr[1], 10) || 0,
patch: parseInt(verArr[2], 10) || 0
@oti
oti / git_diff_archive.sh
Created December 10, 2015 05:07
gitで差分ファイルを抽出する
# http://qiita.com/kaminaly/items/28f9cb4e680deb700833
# --diff-filter=Dがあると期待通りの抽出ができないのでそれを削除している
function git_diff_archive()
{
local diff=""
local h="HEAD"
if [ $# -eq 1 ]; then
if expr "$1" : '[0-9]*$' > /dev/null ; then
diff="HEAD HEAD~${1}"
@oti
oti / event-emitter.js
Last active January 23, 2016 08:02
EventEmitter
(function(w, jQ){
var window = w;
var $ = jQ;
var resizeConfig = {
bindSeletor: window,
name: 'resize',
throttle: true,
threshold: 600,
observabled: [
@oti
oti / transmit-ppk-config-memo.md
Last active February 26, 2016 03:54
(S)FTPでサーバー接続の手続きでパスフレーズつきのppkファイルを使えって言われたら~/.ssh/configで設定する

TransmitだとSFTPプロトコル接続時は、パスワード入力欄の右側の鍵アイコンのボタンからppkファイルとかpemファイルを選択して鍵認証することができる。

transmit-use-ppk

鍵ファイルにパスフレーズがかかっていると、上記のGUIでの読み込みだとTransmitはエラーになってしまう。

transmit-use-ppk-has-pathphrase

なので、パスフレーズつきの時は ~/.ssh/config で設定する。