Skip to content

Instantly share code, notes, and snippets.

View moroya's full-sized avatar

moroya moroya

View GitHub Profile
// first
$(window).queue('myqueue', function() {
console.log('first');
setTimeout(function(){
$(window).dequeue('myqueue');
}, 1000);
});
// second
$(window).queue('myqueue', function() {
@moroya
moroya / jquery.mobile.events.js
Created April 24, 2013 08:48
jQuery mobile 1.3.1からモバイルイベント部分のみを取り出したもの
/**
* jquery.mobile.vmouse.js
*
* https://github.com/jquery/jquery-mobile/blob/1.3.1/js/jquery.mobile.vmouse.js
*
* Copyright 2010, 2013 jQuery Foundation, Inc. and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
@moroya
moroya / AikatsuBot.js
Last active December 14, 2015 05:49
穏やかじゃないBot
// Node.jsで走らせるとよいよ三ε(๑^ᴗ^๑)з スイー
//
// node-twitterを利用してるから
// $ npm install twitter
//
// あと次回のアイカツ時間は手動で打ってるから、
// 実務で利用する場合はAPIで取得するようにしたほうが便利だと思う。
var twitter = require('twitter');
var BOT_ID = 'BOT_ID';
(function(){
var loadCount = 0;
var scriptURL = [
'//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js',
'//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js'
];
function getScript(src, callback) {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
var img = $('<img/>').on('load', function(){
// 読み込めた時の処理
$(this).remove(); // GC
img = null;
}).on('error', function(){
// 読み込めなかった時の処理
$(this).remove(); // GC
img = null;