Skip to content

Instantly share code, notes, and snippets.

View tamoot's full-sized avatar

Masahiro TAMURA tamoot

  • とやまし
  • Toyama, Japan
View GitHub Profile
  • git cloneする
git clone https://github.com/tdiary/tdiary-core tdiary-rdb
git clone https://github.com/tdiary/tdiary-io-rdb tdiary-io-rdb
  • Gemfile.localを作成
@tamoot
tamoot / count_word.bat
Last active December 23, 2015 11:59
引数に指定したMicrosoft Wordファイルのページ数を出力します。 Windows7(x64)にて、.doc, .docxに対して動作を確認しました。 誕生日記念に作成。
@echo OFF
"%WINDIR%\system32\cscript.exe" //NOLOGO count_word.js %1
exit /b 0
@tamoot
tamoot / Gemfile.diff
Last active December 20, 2015 10:09
fcgi対応tDiary Gemfile
index 9aab054..f61c12e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -22,6 +22,10 @@ gem 'hikidoc'
gem 'rdtool'
gem 'fastimage'
+group :fcgi do
+ gem 'fcgi'
+end
@tamoot
tamoot / sample_data.json
Created June 6, 2013 11:21
NHK番組APIが返すと思われるJSON
{
"id": "2013010656789",
"event_id": "56789",
"start_time": "2013-01-06T20:00:00+09:00",
"end_time": "2013-01-06T21:15:00+09:00",
"area": {
"area_id": "130",
"area_name": "東京"
},
"service_": {
@tamoot
tamoot / nhk_program_info.rb
Last active December 18, 2015 03:38
お昼休みに書いた #tDiary 用NHK番組情報埋め込みプラグイン(動作全く未検証)
# -*- coding: utf-8 -*-
#
# nhk_program_info.rb - embedded NHK program information
# refer to the URL below.
# http://www2.nhk.or.jp/api/docs/v1/
#
# Copyright (C) 2013, tamoot <tamoot+tdiary@gmail.com>
# You can redistribute it and/or modify it under GPL2.
#
@tamoot
tamoot / clipboard2browser.vbs
Created May 24, 2013 01:09
VBScriptにてクリップボードの文字列を取得する。ついでに取得した文字列からURLを生成して標準となっているブラウザで開く。Windows7 64bit + Microsoft (R) Windows Script Host Version 5.8 + Firefox 21.0で確認。
Set objHTML = CreateObject("htmlfile")
TEXT = Trim(objHTML.ParentWindow.ClipboardData.GetData("text"))
'launch
Set objShell = CreateObject("WScript.Shell")
objShell.Run "http://hoge.fuga.org?param=" + TEXT
@tamoot
tamoot / outlookからブラウザを開く.vbs
Created May 22, 2013 06:26
クリップボードに入っている文字列から、任意のURLにパラメータを追加してデフォルトのブラウザで開くOutlook用マクロ (Outlookじゃなくてもいいな別に)
Sub clipboard2browser()
'from clipboard
Dim DataObj As New MSForms.DataObject
DataObj.GetFromClipboard
On Error GoTo Whoa
'for browser launch
Dim objShell As Object
Set objShell = CreateObject("WScript.Shell")
@tamoot
tamoot / gist:5537504
Created May 8, 2013 01:20
bundlerが無いとエラーになった tdiary コマンド
[tamoot@bazil]#tdiary new sample_win_2_0_0
D:/Application/ruby_2_0_0_p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- bundler (LoadError)
from D:/Application/ruby_2_0_0_p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from D:/Application/ruby_2_0_0_p0/lib/ruby/gems/2.0.0/gems/tdiary-3.2.2.20130507/tdiary/cli.rb:4:in `<top (required)>'
from D:/Application/ruby_2_0_0_p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from D:/Application/ruby_2_0_0_p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from D:/Application/ruby_2_0_0_p0/lib/ruby/gems/2.0.0/gems/tdiary-3.2.2.20130507/bin/tdiary:5:in `<top (required)>'
from D:/Application/ruby_2_0_0_p0/bin/tdiary:23:in `load'
from D:/Application/ruby_2_0_0_p0/bin/tdiary:23:in `<main' >
@tamoot
tamoot / ldr2ril.rb
Created February 21, 2013 00:03 — forked from yhara/ldr2ril.rb
require 'cgi'
require 'rubygems'
require 'json'
require 'mechanize'
require 'pit'
# LDR
ldr_login = Pit.get("member.livedoor.com", :require => {
"username" => "your livedoor_id",
@tamoot
tamoot / tweet_embeded.js
Created February 18, 2013 13:04
twitter API V1 でのプラグイン
/*
* tweet_embeded.js : embeded tweet
*
* Copyright (C) 2013 by tamoot <tamoot+tdiary@gmail.com>
* You can distribute it under GPL.
*/
$( function() {
function embeded_callback(twitter_status, twitter_p) {