Skip to content

Instantly share code, notes, and snippets.

View tamoot's full-sized avatar

Masahiro TAMURA tamoot

  • とやまし
  • Toyama, Japan
View GitHub Profile
@tamoot
tamoot / rest2html.bat
Created January 21, 2015 06:35
rest2html.py向けbatファイル。これをxyzzyから実行する。
@echo off
D:\App\python_2_7_5\python D:\App\python_2_7_5\Scripts\rst2html.py %1 %1.html --stylesheet D:\App\python_2_7_5\Scripts\custom.css
exit /b 0
@tamoot
tamoot / css4rst.css
Created January 21, 2015 06:34
rst2html.py向けスタイルシート
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
@tamoot
tamoot / memo.txt
Last active August 29, 2015 14:12
puma+apacheでtdiary最新版を動かす方法(2015/01)
1) git clone
pwd
/home/tamoot/workspace/github
git clone https://github.com/tdiary/tdiary-core.git
Cloning into 'tdiary-core'...
remote: Counting objects: 16775, done.
remote: Total 16775 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (16775/16775), 4.56 MiB | 254.00 KiB/s, done.
@tamoot
tamoot / gist:74be5fcc51b90a37facc
Created September 7, 2014 07:55
20140907memo
1) 以下のように仮想IPを設定
ifconfig eth0:0 192.168.1.12
エンドポイント + BSS用reverse proxyのアドレスは計9個必要です。
ifconfig ethN:0 XXX.YYY.ZZZ.AA1
ifconfig ethN:1 XXX.YYY.ZZZ.AA2
:
ifconfig ethN:7 XXX.YYY.ZZZ.AA8
#
# Copyright 2012 Mortar Data Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@tamoot
tamoot / proxy.rb
Created June 9, 2014 02:27 — forked from tomlea/proxy.rb
require "net/http"
require "enumerator"
# Example Usage:
#
# use Rack::Proxy do |req|
# if req.path =~ %r{^/remote/service.php$}
# URI.parse("http://remote-service-provider.com/service-end-point.php?#{req.query}")
# end
# end

PIL(Pillow) build on Windows (32bit & 64bit)

If you want to build PIL on Windows, you need to prepare few external libraries. Although some libraries did not provide static library for windows 32/64 bits then you need to build these libraries by your hand too. Also, PIL will load by python at last then you are recommended to use same compiler with python to build libraries.

Target PIL and versions

Pillow

1.7.8 for Python 2.7: src

@tamoot
tamoot / fake_qa.rst
Created February 27, 2014 02:23
実話を基にした、戦力のフリしてSIerに雇われる3つの受け答え(と心の声)
  • Q1: Cの経験ある?
  • A1: 大丈夫です(たぶん)。
  • Q2: 最近流行(って聞くけどマニアが言ってるだけだろ)のRubyとかできます?
  • A2: 大丈夫です(本屋に行けば本あるかな)
  • Q3: あ、そうだ、Java(これでブラウザてリッチな画面作る作業受注できるな)ってできます?
  • A3: はい。(独習Java持ち込めばいいだろ)
FROM centos
# packages
RUN yum groupinstall -y "Development tools"
RUN yum -y install openssl openssl-devel readline-devel readline compat-readline5 libxml2-devel libxslt-devel libyaml-devel git
# rbenv
RUN git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
RUN mkdir -p ~/.rbenv/plugins && git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
RUN echo -e 'PATH=~/.rbenv/bin:$PATH\neval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh && source /etc/profile.d/rbenv.sh
# ruby
ENV CONFIGURE_OPTS --disable-install-doc
@tamoot
tamoot / nhk_program_info.rb
Last active August 29, 2015 13:55
#tDiary 用NHK番組情報埋め込みプラグイン (動作確認版) あとで contrib 行き。
# -*- coding: utf-8 -*-
#
# nhk_program_info.rb - embedded NHK program information
# refer to following URL.
# http://www2.nhk.or.jp/api/docs/v1/
#
# Copyright (C) 2014, tamoot <tamoot+tdiary@gmail.com>
# You can redistribute it and/or modify it under GPL2.
#