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
1 - ESLint extention enable | |
2 - run cmd: npm install - g eslint | |
3 - run cmd: npm install --save-dev eslint-config-rallycoding | |
4 - create file .eslintrc in folder project | |
5 - content file | |
{ | |
"extends": "rallycoding" | |
} |
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
/** | |
* [force_post_title_init] | |
*/ | |
function force_post_title_init() { | |
wp_enqueue_script('jquery'); | |
} | |
function force_post_title() { | |
echo "<script>jQuery('#publish').click(function(){ | |
var testervar = jQuery('[id^=titlediv]').find('#title'); | |
if (testervar.val().length < 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
<div id="map_canvas" style="width:100%;height:500px;"></div> | |
<script> | |
function initMap() { | |
api = 'https://maps.googleapis.com/maps/api/geocode/json?address={address}®ion=jp&key={key}'; | |
jQuery.getJSON(api, function(r){ | |
var abc = $.parseJSON(JSON.stringify(r)); | |
var lat = abc['results'][0].geometry.location.lat; | |
var lng = abc['results'][0].geometry.location.lng; | |
var uluru = {lat: lat, lng: lng }; |
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_name_kana = array( | |
'あ' => array('あ', 'い', 'う', 'え', 'お', 'ア', 'イ', 'ウ', 'エ', 'オ'), | |
'か' => array('か', 'き', 'く', 'け', 'こ', 'カ', 'キ', 'ク', 'ケ', 'コ'), | |
'さ' => array('さ', 'し', 'す', 'せ', 'そ', 'サ', 'シ', 'ス', 'セ', 'ソ'), | |
'た' => array('た', 'ち', 'つ', 'て', 'と', 'タ', 'チ', 'ツ', 'テ', 'ト'), | |
'な' => array('な', 'に', 'ぬ', 'ね', 'の', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ'), | |
'は' => array('は', 'ひ', 'ふ', 'へ', 'ほ', 'ハ', 'ヒ', 'フ', 'ヘ', 'ホ'), | |
'ま' => array('ま', 'み', 'む', 'め', 'も', 'マ', 'ミ', 'ム', 'メ', 'モ'), | |
'や' => array('や', 'ゆ', 'よ', 'ヤ', 'ユ', 'ヨ'), | |
'ら' => array('ら', 'り', 'る', 'れ', 'ろ', 'ラ', 'リ', 'ル', 'レ', 'ロ'), |
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
/** | |
* Show column name kana | |
*/ | |
if ( ! function_exists( 'kana_cpt_columns' ) ) { | |
function kana_cpt_columns( $columns ) { | |
if ( !isset($_GET['taxonomy']) || $_GET['taxonomy'] != 'category' ) | |
return $columns; | |
$columns["namekana"] = "Name Kana"; | |
return $columns; | |
} |
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 replace($str) { | |
if(!$str) return false; | |
$unicode = array( | |
'a'=>array('á','à','ả','ã','ạ','ă','ắ','ặ','ằ','ẳ','ẵ','â','ấ','ầ','ẩ','ẫ','ậ'), | |
'A'=>array('Á','À','Ả','Ã','Ạ','Ă','Ắ','Ặ','Ằ','Ẳ','Ẵ','Â','Ấ','Ầ','Ẩ','Ẫ','Ậ'), | |
'd'=>array('đ'), | |
'-'=>array('-'), | |
'D'=>array('Đ'), | |
'e'=>array('é','è','ẻ','ẽ','ẹ','ê','ế','ề','ể','ễ','ệ'), | |
'E'=>array('É','È','Ẻ','Ẽ','Ẹ','Ê','Ế','Ề','Ể','Ễ','Ệ'), |
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($){ | |
$.fn.extend({ | |
limit: function(limit,element) { | |
var interval, f; | |
var self = $(this); | |
$(this).focus(function(){ | |
interval = window.setInterval(substring,100); | |
}); | |
$(this).blur(function(){ | |
clearInterval(interval); |
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
/** | |
* Created by ENQ on 7/15/2015. | |
*/ | |
/*---------------------------------------------------------------------------------*/ | |
/* CONFIGS */ | |
/*---------------------------------------------------------------------------------*/ | |
var maxItemAdd = 3; | |
var temp = 0; // for text | |
var tempImg = 0; //for image | |
var count_click = 0; //click |
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
/** | |
* Image size. | |
*/ | |
function image_web_thumb() | |
{ | |
// Image pickup slider | |
add_image_size('thumb-image-130-110',130,110, true); | |
// Image pickup slider |
OlderNewer