Skip to content

Instantly share code, notes, and snippets.

View ko31's full-sized avatar
I want to play catch!

Ko Takagi ko31

I want to play catch!
View GitHub Profile
@ko31
ko31 / takasaki.go.md
Last active March 9, 2017 10:33
Takasaki.go#1 ポジションペーパー
@ko31
ko31 / url.txt
Created March 4, 2017 04:32
第89回センバツ出場校Webサイト一覧
札幌第一,http://www.kibou.ac.jp/daiichi/
仙台育英,http://www.sendaiikuei.ed.jp/i_html/i_top.html
盛岡大付,http://www.morifu.jp/
作新学院,http://www.sakushin.ac.jp/highschool/
東海大市原望洋,http://www.boyo.tokai.ed.jp/
前橋育英,http://www.maebashiikuei-h.ed.jp/
健大高崎,http://www.tuhw-h.ed.jp/
早稲田実,http://www.wasedajg.ed.jp/
日大三,http://www.nichidai3.ed.jp/s_index/
静岡,http://www.edu.pref.shizuoka.jp/shizuoka-h1/home.nsf/IndexFormView?OpenView
@ko31
ko31 / wp-cli-verify-checksums
Created February 15, 2017 12:41
サーバー内にあるWordPress本体の改ざんをチェックする
find . -type f -name 'wp-config.php' -exec bash -c '_wp=$(echo {} | sed -e s/[^\/]*$//); echo -n "${_wp}: "; wp --path=${_wp} core verify-checksums' \; 2>/dev/null
@ko31
ko31 / wp-cli-verify-checksums
Created February 15, 2017 12:37
サーバー内にあるWordPress本体の改ざんをチェックする
find . -type f -name 'wp-load.php' -exec bash -c '_wp=$(echo {} | sed -e s/[^\/]*$//); echo -n "${_wp}: "; wp --path=${_wp} core verify-checksums || echo "WP not installed."' \; 2>/dev/null
@ko31
ko31 / test.php
Last active December 26, 2016 07:57
【PHP】Cloud Vision APIのテスト
<?php
// APIキー
$api_key = "Your API Key";
// 画像パス
$image_path = "/path/to/image.jpg";
// リクエスト用のJSONを作成
$json = json_encode( array(
"requests" => array(
@ko31
ko31 / get_list_data.php
Created December 20, 2016 12:24
【PHP】棋士名を分解してどの文字が何回使われているか取得
<?php
$data = file_get_contents("kishi_all.json");
$data = json_decode($data);
$list = array();
foreach ($data as $kishi) {
$length = mb_strlen($kishi->name, 'UTF-8');
for($i=0; $i<$length; $i++) {
$char = mb_substr($kishi->name, $i, 1, 'UTF-8');
if (isset($list[$char])) {
@ko31
ko31 / example.html
Created December 18, 2016 21:25
jQuery quicksearch plug-in example
<form>
<input type="text" id="search" placeholder="検索キーワードを入れてください">
</form>
<table class="list" id="tabledata">
<tbody>
<tr>
<th>棋士番号</th>
<th>氏名</th>
<th>出身地</th>
@ko31
ko31 / index.html
Created December 16, 2016 02:31
【HTML】棋士出身地マップ
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<link rel="stylesheet" href="css/leaflet.css" />
<script src="js/leaflet.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
@ko31
ko31 / get_pos_data.php
Created December 16, 2016 00:25
【PHP】出身地から緯度・経度を取得したデータを作る
<?php
$key = 'xxxxxxxxxx';
$data = file_get_contents("kishi_all.json");
$data = json_decode($data);
$maps = array();
foreach($data as $kishi) {
$result = file_get_contents('https://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($kishi->birthplace).'&key='.$key);
$result = json_decode($result, true);
if ($result['status'] != 'OK') {
continue;
<?php
$prefecture = array(
array('北海道', 0),
array('青森県', 0),
array('岩手県', 0),
array('宮城県', 0),
array('秋田県', 0),
array('山形県', 0),
array('福島県', 0),
array('茨城県', 0),