This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var img = $('<img/>').on('load', function(){ | |
// 読み込めた時の処理 | |
$(this).remove(); // GC | |
img = null; | |
}).on('error', function(){ | |
// 読み込めなかった時の処理 | |
$(this).remove(); // GC | |
img = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Node.jsで走らせるとよいよ三ε(๑^ᴗ^๑)з スイー | |
// | |
// node-twitterを利用してるから | |
// $ npm install twitter | |
// | |
// あと次回のアイカツ時間は手動で打ってるから、 | |
// 実務で利用する場合はAPIで取得するようにしたほうが便利だと思う。 | |
var twitter = require('twitter'); | |
var BOT_ID = 'BOT_ID'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// first | |
$(window).queue('myqueue', function() { | |
console.log('first'); | |
setTimeout(function(){ | |
$(window).dequeue('myqueue'); | |
}, 1000); | |
}); | |
// second | |
$(window).queue('myqueue', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// first | |
function first() { | |
var df = $.Deferred(); | |
setTimeout(function(){ | |
console.log('first'); | |
df.resolve(); | |
}, 1000); | |
return df.promise(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = require('webpage').create(); | |
var system = require('system'); | |
// 引数を引っ張る | |
var address = system.args[1]; | |
var output = system.args[2]; | |
var delay = Number(system.args[3]); | |
// ビューポートのサイズ | |
page.viewportSize = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var imgs = document.querySelectorAll('a[href*="jpg"], a[href*="gif"], a[href*="png"]'); | |
for(var i=0;i<imgs.length;i++) { | |
dispatchMouseEvents({ type:'click', altKey:true, target:imgs[i], button:0 }); | |
} | |
function dispatchMouseEvents(opt) { | |
var evt = document.createEvent('MouseEvents'); | |
evt.initMouseEvent(opt.type, opt.canBubble||true, opt.cancelable||true, opt.view||window, | |
opt.detail||0, opt.screenX||0, opt.screenY||0, opt.clientX||0, opt.clientY||0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Section 1: Global Environment | |
### Apache全体に影響を及ぼすセクション | |
# Apacheのパス | |
ServerRoot "/etc/httpd" | |
# ポート番号の指定 | |
Listen 80 | |
# 同時接続数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName example.net | |
DocumentRoot "/var/html/www/" | |
<Directory "/var/html/www/"> | |
Order Allow,Deny | |
Allow from All | |
AllowOverride All | |
Options FollowSymLinks | |
</Directory> |
OlderNewer