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 | |
/** | |
* ブラウザをゆるく判別 | |
* | |
* @version 1.2.2 | |
*/ | |
class CheckBrowser | |
{ |
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 paging_numbers(); ?> を挿入することで希望する位置にナビゲーションを出力することができる | |
function paging_numbers(){ | |
global $wp_rewrite, $wp_query, $paged; | |
if(($wp_query->max_num_pages) > 1): | |
if (strpos(($paginate_base = get_pagenum_link(1)), '?') || ! $wp_rewrite -> using_permalinks()) { | |
$paginate_format = ''; | |
$paginate_base = add_query_arg('paged', '%#%'); | |
} else { | |
$paginate_format = (substr($paginate_base, -1 , 1) === '/'? '': '/') . user_trailingslashit('page/%#%/', 'paged'); |
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
$(window).scroll(function(){ | |
var scroll_top = document.body.scrollTop || document.documentElement.scrollTop || document.scrollY || 0; | |
if(scroll_top > 30){ | |
//ブラウザのスクロールバーが30pxより下に行った場合 | |
} | |
if(scroll_top <= 30){ | |
//ブラウザのスクロールバーが30pxより上に行った場合 | |
} |
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 id="reply"> | |
<h2>Comment</h2> | |
<?php | |
$u_comments = get_comments(array( | |
"post_id" => $post->ID, | |
"status" => "approve", | |
"type" => "comment" | |
)); | |
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 feed = new google.feeds.Feed("http://example.com/rss.rdf"),//取得するフィードのURL | |
item_sum = 5,//取得するフィードの数 | |
target_elem = $("div#google_feed_api_example"); | |
target_elem.html("<p class='loading' id='google_feed_api_loading'>...now loading</p>");// ローディング | |
feed.setNumEntries(item_sum); | |
feed.load(function(result){ | |
if(!result.error){ | |
var feed_item = ""; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" exclude-result-prefixes="x rdf skos" | |
xmlns:x="http://www.w3.org/1999/xhtml" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:skos="http://www.w3.org/2004/02/skos/core#" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd" indent="no"/> | |
<xsl:template match="x:head"> |
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
// xor128 class | |
var xor128 = { | |
// member | |
x: 123456789, | |
y: 362436069, | |
z: 521288629, | |
w: 88675123, | |
// method | |
setSeed: function(seed){ |
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 data = new Array(); | |
for(var i=1; i<=100; i++){ | |
if(i%3 ===0||i%5 === 0){// 3か5で割り切れるとき | |
var word = ""; | |
if(i%3 === 0){// 3で割り切れるとき | |
word += "Fizz";// Fizz追加 | |
} | |
if(i%5 === 0){// 5で割り切れるとき | |
word += "Buzz";// Buzz追加 |
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
// 小文字 | |
for($i=0; $i<26; $i++){ | |
echo chr(97+$i); | |
} | |
// 大文字 | |
for($i=0; $i<26; $i++){ | |
echo chr(65+$i); | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<rdf:RDF xml:lang="en" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:skos="http://www.w3.org/2004/02/skos/core#"> | |
<skos:Concept rdf:about="http://example.com/glossary/html"> | |
<skos:prefLabel>HyperText Markup Language</skos:prefLabel> | |
<skos:altLabel>HTML</skos:altLabel> | |
</skos:Concept> | |
</rdf:RDF> |
OlderNewer