Skip to content

Instantly share code, notes, and snippets.

View dataich's full-sized avatar
😀

Taichiro Yoshida dataich

😀
View GitHub Profile
<?php
//
// 画面出力時に、テンプレートをUTF-8からSJISに変換する。
//
function filterUTF8ToSJIS($buff, &$smarty) {
return mb_convert_encoding($buff,"SJIS","UTF-8");
}
$smarty= new Smarty(); //Smartyオブジェクト生成
$smarty->register_outputfilter("filterUTF8ToSJIS"); //フィルターの登録
ini_set("default_charset", "Shift_JIS"); //PHPの設定default_charsetにSJISを設定
内容 Path Key Value
SoftBankメール保存ディレクトリ \HKEY_LOCAL_MACHINE\Software\Arcsoft\ArcSoft MMS UA\Config\Folder CannedTextFile 「Program Files」を「Storage Card」
SoftBankメール保存ディレクトリ \HKEY_LOCAL_MACHINE\Software\Arcsoft\ArcSoft MMS UA\Config\Folder TemplatePath 「Program Files」を「Storage Card」
SoftBankメール保存ディレクトリ \HKEY_LOCAL_MACHINE\Software\Arcsoft\ArcSoft MMS UA\Config\Folder UAContentsPath 「Program Files」を「Storage Card」
IE初期ページ \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AboutURLs home_0409 任意URL
IE初期ページ \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AboutURLs home_0411 任意URL
Outlookメール新規作成時サイズ \HKEY_LOCAL_MACHINE\Software\Microsoft\Inbox\RichEditHostFontSize - 9
HSDPAアイコン表示 \HKEY_LOCAL_MACHINE\Software\OEM\RIL EnableHSDPAIcon 1
キャッシュ \HKEY_LOCAL_MACHINE\System\GDI\GLYPHCACHE limit 2097152
キャッシュ \HKEY_LOCAL_MACHINE\System\StorageManager\FATFS CacheSize 256
<?php
spl_autoload_register(function ($className) {
include "$className.php";
});
class EntryTest extends PHPUnit_Framework_TestCase {
public function testStatus() {
$entry = new Entry();
$this->assertEquals(Entry::STATUS_DRAFT, $entry->status);
<?php
spl_autoload_register(function ($className) {
include "$className.php";
});
class EntrySpec extends PHPUnit_Extensions_Story_TestCase {
/**
* @scenario
*/
@dataich
dataich / Entry.php
Last active February 13, 2019 11:41
<?php
class Entry {
const STATUS_DRAFT = 'draft';
const STATUS_PUBLISHED = 'published';
const STATUS_DELETED = 'deleted';
var $status = self::STATUS_DRAFT;
var $title;
public function publish() {
<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Eclipse on Mac" parent="Eclipse">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta C" />
</action>
<action id="$Cut">
<keyboard-shortcut first-keystroke="meta X" />
<keyboard-shortcut first-keystroke="shift DELETE" />
</action>
<action id="$Delete">
@dataich
dataich / hslide2pdf.sh
Created October 5, 2012 13:25
HTML slides to PDF by cutycapt and imagemagick
#! /bin/sh
filename="slide.pdf"
if [ $# -ne 2 ]; then
echo "Usage: ./hslide2pdf.sh url maxpage"
exit 1
fi
if [ ! -d tmp ] ; then
mkdir tmp
@dataich
dataich / wordpressdotcom.rb
Created May 9, 2012 04:30 — forked from nikushi/wordpressdotcom.rb
A tool to migrate wordpress xml file to jekyll. This is a copied version and I modified a bit for my wordpress data compatibirity. The original is here https://github.com/mojombo/jekyll .
# coding: utf-8
require 'rubygems'
require 'hpricot'
require 'fileutils'
# for multi byte string in yaml
require 'psych'
require 'yaml'
require 'time'
# for multi byte string
@dataich
dataich / phpbrew.rb
Created March 27, 2012 13:22
Formula for phpbrew
require 'formula'
class Phpbrew < Formula
head 'https://raw.github.com/c9s/phpbrew/master/phpbrew'
homepage 'https://github.com/c9s/phpbrew'
def install
system "chmod a+x phpbrew"
system "mkdir -p #{prefix}/bin"
system "cp phpbrew #{prefix}/bin"
@dataich
dataich / my.cnf
Created January 30, 2012 14:19
mysqld_multi config
[mysqld_multi]
mysqld = /usr/local/bin/mysqld_safe # 使用するmysqldバイナリへのフルパス
mysqladmin = /usr/local/bin/mysqladmin # mysqladminへのフルパス
user = XXXX # 全てのサーバで使えるSHUTDOWN権限のあるユーザとパスワード
password = XXXX
[mysqld1]
server-id = 1 # 連番で良いはず
port = 3306 # 使用するポート
datadir = /usr/local/var/mysql_multi/1 # データディレクトリ(分けておかないと大変なことになるはず)