Skip to content

Instantly share code, notes, and snippets.

View ogawa's full-sized avatar
💭
I may be slow to respond.

Hirotaka Ogawa ogawa

💭
I may be slow to respond.
View GitHub Profile
@ogawa
ogawa / sendEmailOnFormSubmit.gs
Created February 19, 2014 07:53
Google Appsでフォームでの投稿をメールで通知するスクリプト
// email address(es) for notification
var NOTIFY_RECIPIENT = 'admin@example.com';
var ADMIN_RECIPIENT = NOTIFY_RECIPIENT;
function sendEmailOnFormSubmit(e) {
var body = '';
var footer = '';
try {
var range = SpreadsheetApp.getActiveSheet().getDataRange();
@ogawa
ogawa / fc.py
Created October 19, 2010 07:55
FacebookCommander - an early prototype of a command-line interface for Facebook
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, getopt
import os, yaml
import cgi
import urllib
import webbrowser
import facebook
@ogawa
ogawa / breadcrumb-example.html
Created November 11, 2010 10:18
Breadcrumb example
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/dresses" itemprop="url">
<span itemprop="title">洋服</span>
</a> ›
<div itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/dresses/real" itemprop="url">
<span itemprop="title">ドレス</span>
</a> ›
<div itemprop="child" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/clothes/dresses/real/green" itemprop="url">
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# EDIT HERE!
OUTPUT_DIR = '/tmp/'
# --- From: http://docs.python.org/library/csv.html
# --- BEGIN
import csv, codecs, cStringIO
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# --- From: http://docs.python.org/library/csv.html
# --- BEGIN
import csv, codecs, cStringIO
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
@ogawa
ogawa / homebrew-emacs-23.3b.diff
Created July 22, 2011 16:40
emacs.rb with emacs-inline and fullscreen patches.
diff --git a/Library/Formula/emacs.rb b/Library/Formula/emacs.rb
index 856a34a..20654fd 100644
--- a/Library/Formula/emacs.rb
+++ b/Library/Formula/emacs.rb
@@ -28,6 +28,7 @@ class Emacs < Formula
def patches
p = []
+ p0 = []
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import csv
from icalendar import Calendar, Event
from datetime import datetime
ical = Calendar()
ical.add('version', '2.0')
-- Eject and Sleep
-- ejectableなディスクをアンマウントしてスリープ
-- アンマウント状態で実行するとマウント
set diskNames to {"HD-PATU3", "Time Machine"}
tell application "Finder"
set disksToEject to {}
repeat with diskName in diskNames
if disk diskName exists then
set aDisk to (disk diskName)
@ogawa
ogawa / jubatus.rb
Last active December 13, 2015 17:48
require 'formula'
class ZooKeeperLib < Requirement
def initialize
@zk = Formula.factory('zookeeper')
end
def fatal?
true
end
diff --git a/FiscalYearlyArchives/fiscal_yearly_archives.pl b/FiscalYearlyArchives/fiscal_yearly_archives.pl
index 4c57e36..fedac03 100644
--- a/FiscalYearlyArchives/fiscal_yearly_archives.pl
+++ b/FiscalYearlyArchives/fiscal_yearly_archives.pl
@@ -57,7 +57,7 @@ sub archive_fiscal_year {
my $tag = $ctx->stash('tag');
return $ctx->error(MT->translate("You used an [_1] tag without a date context set up.", "MT$tag"))
unless defined $ts;
- ts2fiscal($ts);
+ ts2fiscal($ts) + 1;