Skip to content

Instantly share code, notes, and snippets.

View iteman's full-sized avatar

Atsuhiro Kubo iteman

View GitHub Profile
@hidenorigoto
hidenorigoto / gist:960995
Created May 8, 2011 00:45
Request::hasSession()について
  • Request::hasSession()の現在の実装の意図

    1. (意図A)クライアントから送られてきた(本来の意味の)リクエストがセッション有効状態か(=Cookieを持っているか)を調べる
    2. (意図B)単にセッションオブジェクトがあるかないかという判定
    3. (意図C)セッションオブジェクトがあり、開始済みかどうか

    現在のhasSession()メソッドは、意図Aの実装であると考えられる。ただし、以下に挙げる呼び出し箇所では、意図Bなどが混在して用いられていると思われる。

  • Request::hasSession()の使われ方

@rsky
rsky / gist:1102568
Created July 24, 2011 12:26
STDOUTにstream_filter_append
<?php
$stream1 = fopen('php://output', 'wb');
stream_filter_append($stream1, 'string.rot13');
fwrite($stream1, "hoge\n");
fwrite(STDOUT, "hoge\n");
echo "hoge\n";
echo "-\n";
$stream2 = fopen('php://stdout', 'wb');
@hidenorigoto
hidenorigoto / gist:1223740
Created September 17, 2011 07:59
Stagehand_TestRunner for Symfony2

Symfony2のプロジェクトをStagehand_TestRunnerで継続テストする

準備

最初にプリロード用スクリプトを用意します。 プリロードスクリプトでは、Symfony2のカーネルディレクトリ(KERNEL_DIR)の設定と、Symfony2のブートストラップファイルの読み込みを行うようにします。 (app/testrunner_preload.phpに作成します)

@tanakahisateru
tanakahisateru / AnsweringTest.php
Created April 6, 2012 14:28
KPHPUG#3のPhakeで書き下したりコメント打ったりして勉強
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
* PHP version 5.3
*
* Copyright (c) 2012 GOTO Hidenori <hidenorigoto@gmail.com>,
* 2012 KUBO Atsuhiro <kubo@iteman.jp>,
* All rights reserved.
*
@hidenorigoto
hidenorigoto / IntlDateFormatter.php
Last active November 20, 2017 01:32
INTL(ICU)のIntlDateFormatterを使って和暦、曜日を表示
<?php
$date = new \DateTime();
// 平成◯◯年
$dateFormatter = \IntlDateFormatter::create(
"ja_JP@calendar=japanese",
\IntlDateFormatter::FULL,
\IntlDateFormatter::FULL,
"Asia/Tokyo",
\IntlDateFormatter::TRADITIONAL,
@leemour
leemour / FontFix RubyMine
Last active October 6, 2018 06:42
Fixing font anti-aliasing for Ubuntu.
# Change Java Runtime:
sudo update-alternatives --config java
# Delete Open-JDK
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
# Change fonts - remove hinting:
http://askubuntu.com/questions/32624/ugly-fonts-in-netbeans-how-can-i-make-it-use-the-system-font
# Change RubyMine AntiAliasing first:
@hidenorigoto
hidenorigoto / 1_Haydnをコレクション演算部分に適用する例.md
Last active August 29, 2015 14:24
Workflow getActivitiLog (一部Haydn利用)

Haydnをコレクション演算部分に適用する例

利用するコード: https://github.com/phpmentors-jp/workflower/blob/master/src/Workflow/Workflow.php#L411

  • ここではコレクションの要素を変換しつつ、変換結果を見てフィルタし、最終オブジェクトへ変換する。HaydnではPHPの配列/連想配列に入っているものなら何でも扱えるので、このようにオブジェクトのコレクションごと変換・フィルタといった操作として記述できる。
@ykubota
ykubota / Usage.md
Last active November 10, 2021 08:10
Get specified jdk8 version sources from openjdk repository

Usage

bash get_specified_source.sh jdk8u77

Note: This script does not validate the input.

@voluntas
voluntas / shiguredo_model.rst
Last active December 26, 2023 21:46
時雨堂を支えるビジネスモデル

時雨堂を支えるビジネスモデル

更新:2023-12-08
作者:@voluntas
バージョン:2023.2
URL:https://voluntas.github.io/

タイポなどは Twitter の @voluntas までお願いします。