Skip to content

Instantly share code, notes, and snippets.

View hideokamoto's full-sized avatar

Hidetaka Okamoto hideokamoto

View GitHub Profile
@hideokamoto
hideokamoto / wp-add-ogp-image.php
Last active August 29, 2015 14:14
WordPressの検索・アーカイブ・著者ページ一覧にogp:imageを追加するfunctions.phpコード
add_action('wp_head','add_ogp_img');
function add_ogp_img(){
if (is_archive() || is_author() || is_search()){
$homeUrl = get_home_url();
echo "<meta property='og:image' content='{$homeUrl}'/.png'>";
}
}
@hideokamoto
hideokamoto / schema-event-sample.jsonld
Last active August 29, 2015 14:14
schema.orgの@type:Eventのマークアップサンプル
{
"@context": "http://schema.org",
"@type": "Event",
"name": "イベント名",
"location": {
"@type": "Place",
"name":"会場名",
"address": "会場住所",
"url": "http://example.com/Place"
},
@hideokamoto
hideokamoto / schema-event-with-PostalAddress.jsonld
Last active August 29, 2015 14:14
schema.orgのtype:PostalAddressを使ったサンプル
{
"@context": "http://schema.org",
"@type": "Event",
"name": "イベント名",
"location": {
"@type": "Place",
"name":"竹生島神社",
"address": {
"@type": "PostalAddress",
"postalCode":"526-0124",
@hideokamoto
hideokamoto / schema-place.jsonld
Created January 28, 2015 06:20
竹生島をJSON-LD化してみた
{
"@context": "http://schema.org",
"@type": "Place",
"name":"竹生島神社",
"description": "竹生島(ちくぶしま)は、琵琶湖の北部に浮かぶ島。琵琶湖国定公園特別保護地区、国の名勝および史跡に指定されている。",
"geo":{
"@type": "GeoCoordinates",
"latitude":"35.2524",
"longitude":"136.0837"
},
@hideokamoto
hideokamoto / db_sparql.html
Created February 15, 2015 16:09
日本の世界遺産情報をDBpediaから引っ張りだす
<code>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dcterms:<http://purl.org/dc/terms/>
select distinct * where {
?link dcterms:subject <http://ja.dbpedia.org/resource/Category:日本の世界遺産>;
rdfs:label ?name;
rdfs:comment ?cont;
dbpedia-owl:thumbnail ?thumb;
@hideokamoto
hideokamoto / designer.html
Created February 21, 2015 12:40
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@hideokamoto
hideokamoto / designer.html
Last active August 29, 2015 14:15
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
@hideokamoto
hideokamoto / gulpfile.js
Created April 15, 2015 05:19
ymlファイルが更新されたら勝手にDBを更新する
//node.jsのchild-processを呼び出す
var exec = require('child_process').exec;
//ymlファイルの更新を監視する
gulp.task('default',function(){
gulp.watch("orm/yaml/**.yml",['db-update']);
});
//DoctrineでEntityを作る
gulp.task('db-generate-entities', function(){
@hideokamoto
hideokamoto / file0.txt
Last active August 29, 2015 14:21
Reactの環境とかデプロイとかにトライしたメモ ref: http://qiita.com/motchi0214/items/e01b7c10aa210c36f478
mkdir react && cd react
npm install react
@hideokamoto
hideokamoto / twilio-call.php
Created May 29, 2015 12:36
Twillo Shorcode Plugin
<?php
require('Services/Twilio.php');
function twilio_call(){
$account_sid = "";
$auth_token = "";
$from_num = "+81";
$to_num = "+81";
$twiml_url = "";
$client = new Services_Twilio($account_sid, $auth_token);