Skip to content

Instantly share code, notes, and snippets.

Masayuki Ietomi jyokyoku

Block or report user

Report or block jyokyoku

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jyokyoku
jyokyoku / get_gengou.php
Created May 9, 2019
元号取得関数(明治〜令和)
View get_gengou.php
<?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 ) {
@jyokyoku
jyokyoku / gulpfile.js
Last active Jan 31, 2019
ぼくのかんがえたさいきょうのGulpfile
View gulpfile.js
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");
@jyokyoku
jyokyoku / colorme_api_test.php
Created Dec 3, 2018
カラーミーショップ商品取得
View colorme_api_test.php
<?php
define( 'ACCESS_TOKEN', '{アクセストークンを入れます}' );
$query_str = http_build_query( array(
'category_id_big' => '15', // カテゴリーID
'name' => '商品名', // 取得する商品名のLIKE検索
'display_state' => 'showing', // 表示中の商品だけを取得
'limit' => '5', // 最大取得件数
) );
@jyokyoku
jyokyoku / wp_menu_html.html
Last active Oct 16, 2017
wp_menu_html.html
View wp_menu_html.html
<ul>
<li><a href="#">メニュー1</a></li>
<li>
<a href="#">メニュー2</a>
<ul class="sub-menu">
<li><a href="#">サブメニュー1</a></li>
<li><a href="#">サブメニュー2</a></li>
<li><a href="#">サブメニュー3</a></li>
</ul>
</li>
@jyokyoku
jyokyoku / gist:443d2d17c27d80bc0985
Created Nov 3, 2014
Convert iTunes Playlist to Walkman
View gist:443d2d17c27d80bc0985
require 'rubygems'
music_dir = '/Music'
ARGV.each do |filename|
ext = File.extname(filename).downcase
if ext != '.m3u' || !FileTest.exist?(filename)
next
end
View nine_star_ki.php
<?php
class NineStarKi
{
protected static $_names = array(
1 => '一白水星',
2 => '二黒土星',
3 => '三碧木星',
4 => '四緑木星',
5 => '五黄土星',
6 => '六白金星',
View jquery.smoothScroll.js
(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;
}
);
});
@jyokyoku
jyokyoku / assoc_field_validation.php
Created Oct 9, 2011
CakePHP AssocFieldValidationBehavior
View assoc_field_validation.php
<?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);
}
@jyokyoku
jyokyoku / maintenance.php
Created Oct 8, 2011
CakePHP MaintenanceComponent
View maintenance.php
<?php
class MaintenanceComponent extends Object
{
public $components = array('RequestHandler');
public $level = 0;
public $allowedCIDR = array();
public $baseURL = null;
public $errorMethod = 'error404';
public $errorParams = array();
View jquery.twitterTrackback.custom.js
(function($) {
$.fn.twitterTrackback = function(options){
$.twitterTrackback.init(this, options);
$.twitterTrackback.update(1);
return this;
};
$.twitterTrackback = {
$element: null,
options: {
You can’t perform that action at this time.