Skip to content

Instantly share code, notes, and snippets.

View YoshinoriKobayashi's full-sized avatar

Yoshinori Kobayashi YoshinoriKobayashi

View GitHub Profile
@YoshinoriKobayashi
YoshinoriKobayashi / ulr_resolution.js
Last active January 7, 2016 08:41
[JavaScript] URLパラメタを分解する
var params,parameters;
var i=0;
var url = location.href;
// ログインからリダイレクトされたときに、& が & となってしまうため、置換してもとに戻す。
url = url.replace(/&/g,"&");
parameters = url.split("?");
params = parameters[1].split("&");
@YoshinoriKobayashi
YoshinoriKobayashi / _setting-compass.scss
Created January 7, 2016 07:41 — forked from Tenderfeel/_setting-compass.scss
Compass Configurable Variables
//--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--
// Compass Configurable Variables
//
// Compassのmixinとかのオプション
//--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--
//
// # Compass Cross-Browser Support Configuration
// http://compass-style.org/reference/compass/support/
//
// `$legacy-support-for-ie` --- IE6&IE7用のhackを使うならtrue.初期値はfalse
@YoshinoriKobayashi
YoshinoriKobayashi / wp_config_add.php
Created January 5, 2016 16:12
[WordPress] wp_config.php this code it's better to add
// REVISON
define('WP_POST_REVISIONS',2);
//***********************************
// Contact Form 7 Auto p-tag Control
// <pre> tag use when false setting
define( 'WPCF7_AUTOP', false );
@YoshinoriKobayashi
YoshinoriKobayashi / js_hover_action.js
Created December 29, 2015 10:37
[JavaScript] Image is changed at mouse hover . I have only to add 'hover-action' to the class
// Hover Action Image Change
function fncHoverAction(){
//
// If there is hover-action in class,I change an image in mouse hover
//
// How to use
// <img class="hover-action" src="head_text.jpg">
//
// When Mouce Hover change image
// head_text.jpg -> head_text_hover.jpg
@YoshinoriKobayashi
YoshinoriKobayashi / wp_css_cache_clear.php
Created December 27, 2015 23:26
[WordPress]I clear cash using a timestamp.WordPress Debug Mode using
/*-------------------------------------------*/
/* Load CSS
/*-------------------------------------------*/
add_action('wp_enqueue_scripts', 'add_css' );
function add_css(){
// Debug Mode is Cash Clear
if (WP_DEBUG){
$version = date("YmdHis");
} else {
@YoshinoriKobayashi
YoshinoriKobayashi / getTimeStamp.js
Last active January 8, 2016 14:21
[JavaScript] Make TimeStamp Format "yyyymmddHHDDSSMMM" Coped Millimeters second
// JavaScript
// Makeing TimeStamp
// Format: yyyymmddHHDDSSMMM
//
function getTimeStamp(){
var time_stamp;
var objDate = new Date();
time_stamp = objDate.getFullYear() + ( "0"+( objDate.getMonth()+1 ) ).slice(-2) + ( "0"+objDate.getDate() ).slice(-2) + ( "0"+objDate.getHours()).slice(-2) + ( "0"+objDate.getMinutes()).slice(-2) + ( "0"+objDate.getSeconds() ).slice(-2) + ( "00"+objDate.getMilliseconds() ).slice(-3);
@YoshinoriKobayashi
YoshinoriKobayashi / wp_new_article_get.php
Created December 24, 2015 05:08
WordPress acquisition of the new article
// WordPress
// acquisition of the new article
//
// Japanese
// 新着記事の取得
//
$args = array(
'post_type' => 'post',
'posts_per_page' => 3,
'post_status' => 'publish',
@YoshinoriKobayashi
YoshinoriKobayashi / jQuery_noConflict.js
Created December 23, 2015 13:45
jQuery の $ がバッティングした際に、別で最適する noConflictU()
// Uderscore などが $ を使用しているので、無効して再定義。
// 対象のJSファイルのみで有効なので、他のファイルでは、 $ が使える。
// ここでは $ を無効にして、 jq を有効。
var jq = jQuery.noConflict();
@YoshinoriKobayashi
YoshinoriKobayashi / smp_tel_link_add.js
Last active December 23, 2015 12:25
スマホデバイスで 電話リンクを作成するスクリプト
@YoshinoriKobayashi
YoshinoriKobayashi / gist:c51c028a1b1e6e7276bc
Last active August 29, 2015 14:26 — forked from wokamoto/gist:9800905
[WordPress] remote_get transient
<?php
function transient_remote_get($url, $expiration = 3600) {
$transient = 'remote_get-' . md5($url);
if ( ! ($response_body = get_transient($transient)) ) {
$response = wp_remote_get($url);
if( !is_wp_error($response) && $response["response"]["code"] === 200 ) {
$response_body = $response["body"];
set_transient($transient, $response_body, $expiration);
} else {
$response_body = false;