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
// | |
// singleton pattern | |
// | |
var Singleton = (function(){ | |
var instance; | |
return function(){ | |
if(instance){ | |
return instance; | |
}; |
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
//ex -> the_root_category(get_the_category(),"span"); | |
function the_root_category($cat,$mode="li"){ | |
$cat = get_root_category($cat); | |
$cnt = count($cat); | |
$_cat; | |
for($i = 0;$i<$cnt;$i++){ | |
echo "<".$mode." class='catGroup catGroup".$i." ".$cat[$i]->slug."'>".$cat[$i]->name."</".$mode.">"; | |
} | |
}; |
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
// welcart 拡張プラグイン WCEX Mobile | |
// http://www.welcart.com/archives/1626.html | |
// $wcmbのプロパティで環境ごとの分岐ができそうだったのでメモ | |
// ガラケーかどうかの判定っぽい。返り値はintかboolian | |
// PCで0:int スマホで10:int ガラケーでtrue:bool | |
$wcmb['check_garak'] | |
// デバイスの名前が入ってる | |
// PCだとPC:string スマホ、ガラケーだと機種名 |
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
// 使い方は | |
// $arr = priceArr(usces_the_firstPrice('return')); | |
// みたいな感じ。 | |
// 返り値は配列。 | |
// 管理画面で税率は必ず指定しておくこと! | |
function priceArr($price=0){ | |
global $usces; | |
$pos = $usces->options; |
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
module.exports = function( grunt ) { | |
'use strict'; | |
// | |
// Grunt configuration: | |
// | |
// https://github.com/cowboy/grunt/blob/master/docs/getting_started.md | |
// | |
grunt.initConfig({ | |
// ------------------------------------ |
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
$home = isset($_GET['home']) ? $_GET['home'] : 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
<?php | |
// WordPress post moves to custom post. | |
// 参考 -> http://techblog.55w.jp/?p=224 | |
$posts = get_posts(array( | |
'post_type'=>'post', | |
'numberposts'=>500 | |
)); | |
// カテゴリーからカスタムタクソノミーに移動させるときに利用 | |
// keyがカテゴリー名でvalがターム名 | |
// key is category name,val is term name. |
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 paging($query_arr){ | |
global $total_page_num; | |
global $paged; | |
$range = 5; | |
$half = 0; | |
$range_offset = 0; | |
$page_offset = 0; | |
$cnt = '<nav class="paging"><ul>'; | |
// prev | |
if($paged != 1){ |
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
// ============================================================================= | |
// 参照:https://npmjs.org/doc/json.html | |
// ============================================================================= | |
{ | |
// ------------------------------------------------------------------------- | |
// name : プロジェクト名 [必須] | |
// ------------------------------------------------------------------------- | |
"name":"v0.4", | |
// ------------------------------------------------------------------------- |
OlderNewer