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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>そう簡単には読ませてあげませんったー</title> | |
<link href="style.css" rel="stylesheet"> | |
<script src="http://www.google.com/jsapi"></script> | |
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
google.load('jquery', '1.4.3'); |
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 _Hoge = function() { | |
var that = this; | |
return function(val) { | |
that._val = val ? val : null; | |
return that; | |
} | |
}; | |
_Hoge.prototype = { | |
val: function(v) { |
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 sum = function(a) { | |
return a.reduce(function(x, y) { return x + y; }); | |
}; | |
var max = function(a) { | |
return a.reduce(function(x, y) { | |
if (x > y) return x; | |
return y; | |
}); | |
}; |
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 _Ary = function() { | |
var self = this; | |
return function(data) { | |
self.data = data instanceof Array ? data : Array.prototype.slice.call(data); | |
return self; | |
}; | |
}; | |
_Ary.prototype = { |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>view-source</title> | |
</head> | |
<body> | |
<p>以下のリンク先をBookmarkに追加する。</p> | |
<a href="javascript:(function(){var script=document.createElement('script');script.type='text/javascript';script.src='/path/to/view_source.js';document.body.appendChild(script);})()">ソースを表示</a> | |
</body> |
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
<?php | |
function the_tweet_this($template) { | |
global $post; | |
$base_uri = 'http://api.bit.ly/v3/shorten'; | |
$params = array( | |
'login' => YOURLOGINID, | |
'apiKey' => YOURAPIKEY, | |
'format' => 'json', | |
); | |
$params['longUrl'] = urlencode(get_permalink($post)); |
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 iterator = function(arr) { | |
if (!arr.length) throw new TypeError(typeof arr + ' is not permitted.'); | |
var copy = (arr instanceof Array) ? arr.slice() : Array.prototype.slice.call(arr); | |
var len = copy.length; | |
var _move = function(method_name) { | |
var current = copy[method_name](); | |
len--; | |
if (len === -1) throw new Error('Stop Iteration'); | |
return current; | |
}; |
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 _Iterator = function() { | |
var that = this; | |
return function(items) { | |
if (!items.length) throw new TypeError(typeof items + ' is not permitted.'); | |
that._items = (items instanceof Array) ? items.slice() : Array.prototype.slice.call(items); | |
that._limit = that._items.length; | |
that._item; | |
return that; | |
}; |
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
/* 配列周りのメソッド部分がブラウザ依存コードなので、実際はもうちょっとちゃんと書いた方がいい */ | |
/* もしくはMDCからreduce, forEachのコードを引用する */ | |
var Site = function() { | |
this.id = document.getElementsByTagName('body')[0].getAttribute('id'); | |
this.classes = document.getElementsByTagName('body')[0].getAttribute('class').split(' '); | |
this.actions = []; | |
}; | |
Site.prototype = { | |
doAction: function() { | |
var self = this; |
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
<?php | |
/** | |
* HTML widget class | |
* | |
* WPINC/default-widgets.php内にある | |
* WP_Widget_Textを使いやすいように改変したもの | |
* | |
*/ | |
class WP_Widget_HTML extends WP_Widget { |
OlderNewer