Skip to content

Instantly share code, notes, and snippets.

@sakunyo
sakunyo / karma.conf.js
Last active December 20, 2015 10:59
event.accelerationIncludingGravity のテスト
// Karma configuration
// Generated on Wed Jul 31 2013 11:47:28 GMT+0900 (JST)
// base path, that will be used to resolve files and exclude
basePath = '';
// list of files / patterns to load in the browser
files = [
The MIT License
Copyright (c) {year} {copyright holders}
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH T
.idea/
@sakunyo
sakunyo / README.md
Last active December 11, 2015 11:18
jquery.spriteOver.js

jquery.spriteOver.js

BackgroundPosition Sprite Animation と Margin Sprite Animation に対応した Sprite アニメーションロールオーバープラグイン

対応ブラウザ: E6+

@sakunyo
sakunyo / README.md
Last active December 11, 2015 05:58
rollover.js

rollover.js

A要素ロールオーバーを追加したイベント画像置換スクリプト

jQuery(document).ready(function($) {
	// initialize Rollover
	var btn_images = new Rollover({
		item   : $("input.btn_image, a.btn_image"),
		normal : "_off.",

swapped: "_on."

@sakunyo
sakunyo / README.md
Last active December 11, 2015 03:29
jquery.dualtab.js

jquery.dualtab.js プラグイン

Script Spec.

  • require: jQuery v1.8.3 - v1.10.2
  • Event binding: .bind()

使い方

HTML

@sakunyo
sakunyo / gist:4283357
Created December 14, 2012 07:12
Dreamweaverのテンプレ
<title>@@((dw_title=='')?'':dw_title+'|')@@@@((dw_depth4_name=='')?'':dw_depth4_name+'|')@@@@((dw_depth3_name=='')?'':dw_depth3_name+'|')@@@@((dw_depth2_name=='')?'':dw_depth2_name+'|')@@SITE Title</title>
<!-- TemplateParam name="dw_depth2_name" type="text" value="" --><!-- TemplateParam name="dw_depth2_path" type="text" value="" -->
<!-- TemplateParam name="dw_depth3_name" type="text" value="" --><!-- TemplateParam name="dw_depth3_path" type="text" value="" -->
<!-- TemplateParam name="dw_depth4_name" type="text" value="" --><!-- TemplateParam name="dw_depth4_path" type="text" value="" -->
<li class="home"><a href="/">HOME</a></li>
@@((dw_depth2_name=='')?'':'<li>')@@@@((dw_depth2_path=='')?'':'<a href="'+dw_depth2_path+'">')@@@@(dw_depth2_name)@@@@((dw_depth2_path=='')?'':'</a>')@@@@((dw_depth2_name=='')?'':'</li>')@@
@@((dw_depth3_name=='')?'':'<li>')@@@@((dw_depth3_path=='')?'':'<a href="'+dw_depth3_path+'">')@@@@(dw_depth3_name)@@@@((dw_depth3_path=='')?'':'</a>')@@@@((dw_depth3_name=='')?'':'</li>')@
@sakunyo
sakunyo / gist:4283353
Created December 14, 2012 07:11
昔Dreamweaver で使ってたスニペット
<html>
<head>
<title>@@((dw_title=='')?'':dw_title+'|')@@SITE Title</title>
<meta name="keywords" content="SITE Default Keywords @@((dw_keys=='')?'':','+dw_keys)@@" />
<meta name="description" content="@@((dw_desc=='')?'':'「'+dw_desc+'」をご覧の皆様へ。')@@ SITE Default Description" />
<link rel="alternate" type="application/rss+xml" href="/rss.xml" />
<!-- TemplateParam name="dw_title" type="text" value="タイトル" -->
@sakunyo
sakunyo / gist:4129751
Created November 22, 2012 06:56 — forked from katzchang/gist:4126092
rebaseはコミットグラフを綺麗にするためじゃなくてffマージをするためにあるのであった

ということで、ffマージはなぜ優れているかというと、マージ操作の際に機械的な構成変更が一切行われず、ブランチの移動が起こるのみなので、マージ後のブランチは、 必ず あなたが入念にテストしただろうマージしたブランチと全く同じ構成であることが保証されるわけである。これが大きい。

衝突検知をくぐり抜けて機械的マージが構成を壊してしまう例は他をご参照いただくとして、no-ffマージの場合にそういう面倒に対応する手段として次のようなものがあると思うが、いずれも確実性でffマージには劣る:

  • マージ前にバックマージを行い、マージ時の際をなくする
  • バックマージからマージまでの間に誰かのコミットが入るかもしれないので、たまに衝突したときのことも考えないとね
  • マージ後のテストで問題を発見し、修正をコミットする
  • 修正って場合によっては時間がかかる仕事でそのあいだmasterは不安定だし、マージ権限を持つ人が少数だとしたら負担でかいよね

ということで、どちらもffマージの恩恵を考えると、なかなか悩ましい。

@sakunyo
sakunyo / SwfoWrapper.js
Created June 4, 2012 09:48
SwfoWrapper.js
(function(w){
var SwfoWrapper = function(options){
this.initialize(options);
};
SwfoWrapper.prototype = {
callback_: function(e){
// swfobject Callback
var condition = "SmartPhone";