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 / 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 / _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 / 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 / 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 / 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 / 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(); // 現在の日付を確認