Skip to content

Instantly share code, notes, and snippets.

@ameyamashiro
ameyamashiro / array-name.js
Last active June 24, 2016 05:28
Prefectures of Japan
var prefectures = [
["", "選択して下さい"],
["北海道", "北海道"],
["青森県", "青森県"],
["岩手県", "岩手県"],
["宮城県", "宮城県"],
["秋田県", "秋田県"],
["山形県", "山形県"],
["福島県", "福島県"],
["茨城県", "茨城県"],
@ameyamashiro
ameyamashiro / index.html
Last active May 13, 2016 02:05
Generate Option tag string from ccomma-separated value.
<p>カンマ区切りで入力した値で option タグを生成。</p>
<textarea id="input-area" cols="30" rows="10"></textarea>
<button>Generate</button>
<div class="ret"></div>
<script>
// extract option list array from comma separated text
var extractArray = function() {
@ameyamashiro
ameyamashiro / git-diffzip
Created January 12, 2016 06:20
Git リポジトリから指定の Commit までの差分ファイルをまとめて zip ファイルを作成
#!/bin/sh
source "$(git --exec-path)/git-sh-setup"
# echo $GIT_DIR
# echo $GIT_OBJECT_DIRECTORY
EXPORT_FILENAME="diff-"`git rev-parse $1 | cut -b1-7`"-to-"`git rev-parse HEAD | cut -b1-7`
if [[ $# == 1 ]]; then
if [[ -n $(git rev-parse --verify --quiet $1) ]]; then
@ameyamashiro
ameyamashiro / jQuery.TLA.coffee
Created August 12, 2014 11:07
タイムラインアニメーション
# jQuery.TLA.coffee
# Ver: 0.1
#
# タイムラインアニメーション
#
#
# 1. アニメーション要素の設定
# TLA.setElements
# $wrapper: $('#wrapper')
# $line: $('<div></div>')
(function() {
var SizeComputer, _computeWidth;
_computeWidth = function(originWidth, baseWidth, refWidth) {
var rate;
rate = originWidth / baseWidth;
return refWidth * rate;
};
SizeComputer = function(varArgs) {
@ameyamashiro
ameyamashiro / jquery.transit-fallback.js
Created August 12, 2014 10:51
Add fallback to transit.js
(function() {
$.fn.transitAnimate = function(properties, duration, easing, callback) {
var deepFallback, fallbackCSS, hasDelay, needFallback, self;
self = this;
hasDelay = false;
needFallback = false;
deepFallback = false;
fallbackCSS = {};
if (properties.hasOwnProperty('delay')) {
hasDelay = true;