This file contains hidden or 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
const strToRgb = function(str) { | |
const hslToRgb = function(hue, saturation, lightness) { | |
const chroma = (1 - Math.abs((2 * lightness) - 1)) * saturation; | |
let huePrime = hue / 60; | |
const secondComponent = chroma * (1 - Math.abs((huePrime % 2) - 1)); | |
huePrime = Math.floor(huePrime); | |
let red; | |
let green; |
This file contains hidden or 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 | |
add_filter( 'get_post_metadata', 'get_preview_post_meta_data', 10, 4 ); | |
add_action( 'wp_insert_post', 'save_preview_post' ); | |
add_action( 'save_preview_postmeta', 'acf_save_preview_postmeta' ); | |
function get_preview_post_meta_data( $meta_value, $post_id, $meta_key, $single ) { | |
global $post; | |
if ( ! empty( $_GET['preview'] ) && $post->ID == $post_id ) { | |
$preview = wp_get_post_autosave( $post_id ); |
This file contains hidden or 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 get_gengou( $time, $format = '%s%s' ) { | |
list( $y, $m, $d ) = explode( ' ', date( 'Y m d', is_numeric( $time ) ? $time : strtotime( $time ) ) ); | |
$gengou = ''; | |
if ( $y < 1868 ) { | |
return $gengou; | |
} | |
if ( $y >= 1868 && $y < 1912 ) { |
This file contains hidden or 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
const gulp = require("gulp"); | |
const sass = require('gulp-sass'); | |
const sassGlob = require('gulp-sass-glob'); | |
const plumber = require('gulp-plumber'); | |
const concat = require('gulp-concat'); | |
const sourcemaps = require('gulp-sourcemaps'); | |
const cleanCss = require('gulp-clean-css'); | |
const browserSync = require('browser-sync'); | |
const named = require('vinyl-named'); | |
const ejs = require("gulp-ejs"); |
This file contains hidden or 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 | |
define( 'ACCESS_TOKEN', '{アクセストークンを入れます}' ); | |
$query_str = http_build_query( array( | |
'category_id_big' => '15', // カテゴリーID | |
'name' => '商品名', // 取得する商品名のLIKE検索 | |
'display_state' => 'showing', // 表示中の商品だけを取得 | |
'limit' => '5', // 最大取得件数 | |
) ); |
This file contains hidden or 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
require 'rubygems' | |
music_dir = '/Music' | |
ARGV.each do |filename| | |
ext = File.extname(filename).downcase | |
if ext != '.m3u' || !FileTest.exist?(filename) | |
next | |
end |
This file contains hidden or 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 | |
class NineStarKi | |
{ | |
protected static $_names = array( | |
1 => '一白水星', | |
2 => '二黒土星', | |
3 => '三碧木星', | |
4 => '四緑木星', | |
5 => '五黄土星', | |
6 => '六白金星', |
This file contains hidden or 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($, window) { | |
$(function() { | |
$('a[href^="#"]').click( | |
function() { | |
var nY = Math.min($($(this).attr("href")).offset().top, $(document).height() - $(window).height()); | |
$('html,body').animate({ scrollTop:nY }, '1.3'); | |
return false; | |
} | |
); | |
}); |
This file contains hidden or 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 | |
class AssocFieldValidationBehavior extends ModelBehavior | |
{ | |
public function checkAssocField($Model, $check, $assocField, $assocValueList = null, $delegateRule = null) | |
{ | |
$key = 0; | |
if (is_array($check)) { | |
list($key, $check) = each($check); | |
} |
NewerOlder