Skip to content

Instantly share code, notes, and snippets.

<aside id="sidebar">
<?php dynamic_sidebar(); ?>
</aside>
@hitsujixgit
hitsujixgit / show-page-content
Last active August 29, 2015 14:01
固定ページの本文を挿入するコード
<?php
if(have_posts()) {
echo '<h2 class="post-title">'.$title.'</h2>';
// 固定ページ "category-information-acquisition" の本文を挿入する
$cat_discription_page = get_page_by_path('category-information-acquisition');
if(isset($cat_discription_page)) {
echo '<div class="post-content">'.apply_filters('the_content', $cat_discription_page->post_content).'</div><hr />';
}
while(have_posts()) {
the_post();
@hitsujixgit
hitsujixgit / index.html
Created May 25, 2014 23:51
Show Yokohama city map.
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v0.min.js"></script>
<style type="text/css">
h1 {
font-size: 16px;
}
@hitsujixgit
hitsujixgit / index.html
Created May 29, 2014 05:35
Show words' name on Yokohama city map.
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v0.min.js"></script>
<style type="text/css">
h1 {
font-size: 16px;
}
@hitsujixgit
hitsujixgit / replace_text.py
Last active August 29, 2015 14:02
Read text file and replace words (utf-8)
#coding:utf-8
'''
Created on 2014/03/27
@author: hitsuji
'''
import csv
# 置換リストをCSVファイルで読み込む
words_filename = 'replace_words'
@hitsujixgit
hitsujixgit / replace_words.csv
Created June 3, 2014 14:01
Word name to its city code.
港南区 id141119
鶴見区 id141011
神奈川区 id141020
西区 id141038
中区 id141046
南区 id141054
保土ケ谷区 id141062
磯子区 id141071
金沢区 id141089
港北区 id141097
@hitsujixgit
hitsujixgit / functions.php
Last active August 29, 2015 14:02
Regist sidebars
<?php
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '<li>',
'after_widget' => '</li>',
'before_title' => '<h2>',
'after_title' => '</h2>'
)
);
@hitsujixgit
hitsujixgit / index.php
Created June 13, 2014 14:54
Test to show sidebar
<!DOCTYPE html>
<html>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
<title><?php bloginfo('name'); ?></title>
</head>
<body>
<ol>
<?php dynamic_sidebar(); ?>
@hitsujixgit
hitsujixgit / output.html
Last active August 29, 2015 14:02
Show sidebar
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="http://localtest.net/wp-content/themes/sample01/style.css" type="text/css" />
<title>Hitsuji x Web</title>
</head>
<body>
<ol>
<li>
@hitsujixgit
hitsujixgit / conv_csv_to_json.py
Created June 14, 2014 12:05
Read CSV file and convert it to JSON format (UTF-8 encoding)
#coding:utf-8
'''
Created on 2014/03/27
@author: Tae Matsumoto
CSVファイルを読み込み、同名のJSONファイルを出力します。
'''
import csv, json