Skip to content

Instantly share code, notes, and snippets.

View kohki-shikata's full-sized avatar

Kohki SHIKATA kohki-shikata

View GitHub Profile
@kohki-shikata
kohki-shikata / zusaar_count
Last active December 16, 2015 03:19
WordPress Shortcode counts attendance from a Zusaar event
function zusaar_count($atts){
extract(shortcode_atts(array(
'zid' => null
), $atts));
// return $zid;
define("ZUSAAR_API_EVENT_URI", "http://www.zusaar.com/api/event/?event_id="); //イベント自体のデータを取得。開催日時の取得用
define("ZUSAAR_API_USER_URI", "http://www.zusaar.com/api/event/user/?event_id="); //イベント出席者のデータを取得
$today = time(); // 現在の日付を確認
@kohki-shikata
kohki-shikata / addCssInSpPageType.php
Last active January 3, 2016 13:09
**For concrete5Add custom css file in the specified page type.Required css file same named as page type handle, in the template directory.
<?php
$pageType = $c->getCollectionTypeHandle();//ページタイプのハンドルを取得
$pageTypeCss = $this->getThemePath() . "/css/" . $pageType . ".css";//そのハンドルの名前を使ったcssがあるとすると
$checkExists = file_exists($pageTypeCss);//そもそもそのcssファイルが存在するか
if(!$checkExists):?>
<link rel="stylesheet" href="<?php echo $pageTypeCss;?>">
<?php endif; // あるならlinkタグで出力。ないならそのまま ?>
@kohki-shikata
kohki-shikata / gist:8797756
Created February 4, 2014 03:33
campaing banner
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>deadline php</title>
</head>
<body>
<?php
$current = time();//現在時刻の取得
@kohki-shikata
kohki-shikata / app.css
Last active October 30, 2015 22:20
Disable Responsiveness on Foundation 5
.row {
max-width: none;
width: 960px; /* any width you want */
}
@kohki-shikata
kohki-shikata / _settings.scss
Created May 4, 2015 09:29
Foundation for sites with Sass verision for Prepros project
// You SHOULD check the version of Foundation and _setting.scss.
// If you don't understant these files how they work, should change just path on Line:58(on this file, Line:61).
// Foundation by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
//
// Table of Contents
@kohki-shikata
kohki-shikata / add_class_last_elem.php
Last active August 29, 2015 14:20
Grids by Foundation 5 need to add html class ".end" to the last element in ".row" element. This is how fix it by PHP.
<?php
// make random color codes for background, to recognize betweens of each columns easily.
function rand_color() {
return sprintf("#%06x",rand(0,16777215));
}
$color = rand_color();
@kohki-shikata
kohki-shikata / index.jade
Created August 15, 2015 04:15
Jade version of Initial index.html for Foundation 5
doctype html
html.no-js(lang='en')
head
meta(charset='utf-8')
meta(name='viewport', content='width=device-width, initial-scale=1.0')
title Foundation
link(rel='stylesheet', href='stylesheets/app.css')
script(src='bower_components/modernizr/modernizr.js')
body
.row
@kohki-shikata
kohki-shikata / app.js
Created November 12, 2015 03:06
jQuery Roll Over
// img roll over
$(function(){
$("img[src*='_on']").addClass("current");
$("img,input[type='image']").hover(function(){
if ($(this).attr("src")){
$(this).attr("src",$(this).attr("src").replace("_off.", "_on."));
}
},function(){
if ($(this).attr("src") && !$(this).hasClass("current") ){
@kohki-shikata
kohki-shikata / to_top.js
Last active November 28, 2015 13:21
jQuery ToTop button
// this script depends on jQuery
$('#toTop').click(function(){
var speed = 400;
var href= $(this).attr("href");
var target = $(href == "#" || href == "" ? 'html' : href);
var position = target.offset().top;
$("html, body").animate({scrollTop:position}, speed, "swing");
return false;
});
@kohki-shikata
kohki-shikata / app.js
Created November 12, 2015 05:22
jQuery add class current page navigation
// add class current page navigation
$(document).ready(function() {
var url = location.pathname;
if(location.pathname != "/") {
$('nav.subpage_sidebar a[href^="' + location.pathname + '"]').parent().addClass('active');
} else $('nav.subpage_sidebar a:eq(0)').parent().addClass('active');
//console.log(url);