Skip to content

Instantly share code, notes, and snippets.

View tochiz's full-sized avatar

tochiz tochiz

View GitHub Profile
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#,
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2012-03-31 11:01+0900\n"
# coding: utf-8
#
# POファイルの中の空白2つ開けてコメントしている部分を
# # コメント
# # > コメント
# のように変更し、前後に空白を入れるスクリプト
# 翻訳用
#
import os.path, sys ,string, re
@tochiz
tochiz / thread_test.py
Created December 10, 2011 12:51
test for thread.
import threading
import time
i = 0
class test(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.daemon = True
def run(self):
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
inherit eutils
DESCRIPTION="fswebcam is a neat and simple webcam app."
HOMEPAGE="http://www.firestorm.cx/fswebcam/"
SRC_URI="http://www.firestorm.cx/fswebcam/files/${P}.tar.gz"
LICENSE="GPL-2"
@tochiz
tochiz / delete_inbox.php
Created November 15, 2011 13:33
delete all mail in inbox from imap mail box.
<?php
/*
* delete_inbox.php
* inboxを空にする。cronなどで回す
*/
// IDとパスワードとホスト名。SSL検証はエラー出るので回避。
$id = '';
$ps = '';
$host = '{imap.ezweb.ne.jp:993/imap/ssl/novalidate-cert}';
@tochiz
tochiz / sample.cpp
Created November 5, 2011 03:36
Sample for OpenCV for image input & output.
#include <cmath>
#include <cv.h>
int main()
{
// Mat形式の画像データを作る
cv::Mat img;
//
img = cv::imread("input.png");
@tochiz
tochiz / CMakeLists.txt
Created November 5, 2011 03:08
OpenCVsample CMake
PROJECT( opencvtest_proj )
FIND_PACKAGE( OpenCV REQUIRED )
FILE(GLOB SRCS *.cpp)
ADD_EXECUTABLE( opencvtest ${SRCS} )
TARGET_LINK_LIBRARIES( opencvtest ${OpenCV_LIBS} )
@tochiz
tochiz / gist:1170899
Created August 25, 2011 15:18
cairo-1.10.2 for gentoo prefix work on lion patch.
--- a/src/cairo-quartz-font.c
+++ b/src/cairo-quartz-font.c
@@ -61,6 +61,10 @@
* This macro can be used to conditionally compile backend-specific code.
*/
+/* These functions have been removed on 10.7; as a workaround, just do
+ * a cast as the ATSFontRef and ATSUFontID should have the same value... */
+#define FMGetATSFontRefFromFont(x) ((ATSFontRef) x)
+
@tochiz
tochiz / gist:1160558
Created August 21, 2011 12:38
eselect-php fix for prefix
--- app-admin/eselect-php/eselect-php-0.6.4.ebuild.orig 2011-02-28 21:34:04.000000000 +0900
+++ app-admin/eselect-php/eselect-php-0.6.4.ebuild 2011-08-21 20:48:02.000000000 +0900
@@ -19,6 +19,12 @@
src_install() {
mv eselect-php-${PV} php.eselect
+
+ # install to prefix usr/bin
+ sed -i -e 's/file \/usr\/bin/file "\${EPREFIX}"\/usr\/bin/' php.eselect || die
+ sed -i -e 's/php-cgi \/usr\/bin/php-cgi "\${EPREFIX}"\/usr\/bin/' php.eselect || die
@tochiz
tochiz / gist:1160550
Created August 21, 2011 12:32
diff php-5.3.6-r1 gentoo prefix for testing
--- dev-lang/php/php-5.3.6-r1.ebuild.orig 2011-05-12 05:01:26.000000000 +0900
+++ dev-lang/php/php-5.3.6-r1.ebuild 2011-08-21 19:50:35.000000000 +0900
@@ -346,7 +346,7 @@
src_prepare() {
eblit-run src_prepare v3 ;
- if [[ ${CHOST} == *-darwin* ]] ; then
+ if [[ ${CHOST} == *-darwin* ]] && [[ ${CHOST} != *-darwin11 ]] ; then
# http://bugs.php.net/bug.php?id=48795, bug #343481
sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die