笑いながらコードを書く。

vimから出たくないフロントエンドエンジニアの備忘録的な何か。

テキストをシャッフルしつつ表示する

後で見なおしてみる。

function ShuffleText(container, speed, easing) {
        this.container  = container;
        this.speed      = speed;
        this.easing     = easing;
        this.isShuffling = false;
    }
    ShuffleText.prototype.shuffle = function (targetText, endress) {
        if (this.isShuffling) {
            clearInterval(this.timerId);
        }
        this.isShuffling = true;

        var self = this,
            length = targetText.length,
            str = "",
            completeText = "",
            tempSpeed = this.speed,
            count = 0,
            timeCount = 0,
            timerId;
        timerId = setInterval(function () {
            if (!endress) {
                ++timeCount;
                if (timeCount >= tempSpeed) {
                    ++count;
                    timeCount = 0;
                    completeText = targetText.slice(0, count);

                    if (self.easing) {
                        tempSpeed += (0 - tempSpeed) / 10;
                    }
                }
            }
            str = completeText + self.getRandomText(length - count);
            self.container.innerHTML = str;

            if (count == length) {
                clearInterval(timerId);
                self.isShuffling = false;
            }
        }, 1000 / 30);
    };
    ShuffleText.prototype.getRandomText = function (length) {
        var i = 0,
            randomLength = ShuffleText.RANDOM_CHAR.length,
            str = "";
        for (; i < length; ++i) {
            str += ShuffleText.RANDOM_CHAR.charAt(~~(Math.random() * randomLength));
        }
        return str;
    };
    ShuffleText.RANDOM_CHAR = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!?@#$%^&*";

enchant.js使用時、iOSでviewportが書き換えられ、画面が広がってしまう場合の対処方法

iOSの場合、どうにもviewportを書き換えてる模樣。
自前でzoom:0.5;してmargin:0 auto; でセンタリングしたら可笑しくなったので気づいた。 

http://yslibr4ry.blogspot.jp/2012/06/enchant-js-iphone.html

 

どうにも勝手にやっちゃってる系みたいなのでどうにかならんのか・・・

使ってるvimプラグインの一覧

登壇してたら使ってるプラグイン教えて欲しいと言われたので。

今のところの一覧です。

 

" My Create plugin

" NeoBundle 'AtsushiM/simple-todo'

NeoBundle 'AtsushiM/simple-memo'

" NeoBundle 'AtsushiM/simple-bookmark'

" NeoBundle 'AtsushiM/simple-download'

NeoBundle 'AtsushiM/css-skelton.vim'

NeoBundle 'AtsushiM/RetinaResize'

NeoBundle 'AtsushiM/html-minifier.vim'

NeoBundle 'AtsushiM/css-minifier.vim'

NeoBundle 'AtsushiM/auto-make.vim'

NeoBundle 'AtsushiM/sass-compile.vim'

NeoBundle 'AtsushiM/get-gitrepo.vim'

NeoBundle 'AtsushiM/findpath.vim'

NeoBundle 'AtsushiM/findpath-edit.vim'

NeoBundle 'AtsushiM/findpath-absolute.vim'

NeoBundle 'AtsushiM/Vake.vim'

 

NeoBundle 'AtsushiM/goodbye-jquery.vim'

NeoBundle 'AtsushiM/image2base64.vim'

" NeoBundle 'AtsushiM/haml-compiler.vim'

NeoBundle 'AtsushiM/jasmine-helper.vim'

 

" My Bundles here:

NeoBundle 'Shougo/neocomplcache'

NeoBundle 'Shougo/neocomplcache-snippets-complete'

NeoBundle 'Shougo/vimfiler'

" NeoBundle 'kchmck/vim-coffee-script'

NeoBundle 'othree/html5.vim'

" NeoBundle 'hokaccha/vim-html5validator'

NeoBundle 'thinca/vim-qfreplace'

" NeoBundle 'thinca/vim-quickrun'

" NeoBundle 'tpope/vim-repeat'

NeoBundle 'tpope/vim-surround'

NeoBundle 'vim-scripts/tComment'

NeoBundle 'kana/vim-smartchr'

NeoBundle 'mattn/zencoding-vim'

" NeoBundle 'Lokaltog/vim-powerline'

" NeoBundle 'mattn/gist-vim'

" NeoBundle 'vim-scripts/YankRing.vim'

NeoBundle 'nathanaelkane/vim-indent-guides'

NeoBundle 'scrooloose/syntastic'

" NeoBundle 'banyan/Vimpusher'

NeoBundle 'tanabe/WriteJSDocComment.vim'

" NeoBundle 'gregsexton/VimCalc'

NeoBundle 'sjl/gundo.vim'

NeoBundle 'mileszs/ack.vim'

NeoBundle 'tell-k/vim-browsereload-mac'

NeoBundle 'jsx/jsx.vim'

NeoBundle 'vim-scripts/zoom.vim'

NeoBundle 'godlygeek/tabular'

 

NeoBundle 'thinca/vim-showtime'