Skip to content

Instantly share code, notes, and snippets.

View tomotomo's full-sized avatar

Tomoyuki Sugita tomotomo

View GitHub Profile
@tomotomo
tomotomo / cptm-ja.mo
Last active December 16, 2015 04:29 — forked from hissy/cptm-ja.po
Gitリポジトリで管理しているWordPressプラグインを
SVNリポジトリと同期しておく方法について miya0001 さんからアドバイスもらった。
rsync不勉強なので忘れないようにメモメモ
```
rsyncの時に余計なファイルを持ってかないように.bash_profileに以下のように入れとくと便利。
alias rsync="rsync -avz --exclude=\".svn\" --exclude=\".DS_Store\" --exclude=\".git\""
```
@tomotomo
tomotomo / genGantaiData.php
Last active January 30, 2016 04:49
Paizaの眼帯がゲットできなくてむしゃくしゃしたからテストデータ生成スクリプト作った
<?php
# 利用例
# $ php genGantaiData.php > data.txt
$n = 30;
echo $n . PHP_EOL;
$data1 = output($n);
echo $data1[0] . PHP_EOL;
echo $data1[1] . PHP_EOL;
# -*- coding: utf-8 -*-
from natto import MeCab
mc = MeCab()
# テキストは cookbiz.jp より
text = "お仕事については基本的には店舗に配属してからのOJTが中心となりますが、先輩スタッフがしっかりとサポートしてくれるので、どなたも安心してお仕事していただけます。2013年には本社内に開発室を設置。店舗配属前にもトレーニングを行なってから実際の店舗に配属されるなど、サポート体制がしっかりと整っているのも当社の魅力。実際、経験が浅い方や未経験スタートのスタッフも多数活躍中!"
print ('Input text:\n'+text)
$ time php test01.php
real 0m0.213s
user 0m0.063s
sys 0m0.039s
$ time php test02.php
real 0m0.083s
user 0m0.050s
sys 0m0.020s
@tomotomo
tomotomo / __MAGIKCRAFT__.tomotomo.magikcraft_spells.md
Last active September 10, 2017 07:06
Magikcraft Spells, by tomotomo.
@tomotomo
tomotomo / RaspberryPi
Last active December 1, 2018 15:16
enebularを触ってRaspberryPiへのデプロイを試みた(初心者向けチュートリアル) ref: https://qiita.com/tomotomo/items/b84b72b6169fb430a907
$ node -v
v8.11.1
@tomotomo
tomotomo / main.py
Last active September 7, 2019 09:37
Control Philips Hue with Makeblock Halocode
# generated by mBlock5 for HaloCode
# codes make you happy
import event, halo
import urequests
# initialize variables
wifi_ready = 0
on = 0
ENDPOINT = "http://xx.xx.xx.xx/api/H1lG5096CkoA023qmfo************/groups/n/action"
@tomotomo
tomotomo / README.md
Created February 22, 2020 10:35
気象庁の気温データを結合するスクリプト

気象庁の気温データ5年分を一つのCSVにしたくて作ったスクリプトです。

  • ダウンロード制限のために、一度にダウンロードできるのは1メトリクスにつき1年分が限界
  • 最初に3行、CSVファイルの説明文が入っている
  • データのヘッダー行が日本語
  • エンコーディングがShift_JIS

以上の制約があったので、機械学習で使いやすいCSVに変換するスクリプトを作りました。

ご自由にお使いください。

@tomotomo
tomotomo / rekidai.py
Last active June 10, 2020 08:04
歴代内閣総理大臣のpython配列データ (出典:https://www.kantei.go.jp/jp/rekidai/ichiran.html )
rekidai = [
'歴代内閣総理大臣',
'伊藤博文',
'黒田清隆',
'山縣有朋',
'松方正義',
'伊藤博文',
'松方正義',
'伊藤博文',
'大隈重信',