Skip to content

Instantly share code, notes, and snippets.

View heavenshell's full-sized avatar
💭
Use Vim

Shinya Ohyanagi heavenshell

💭
Use Vim
  • Hyogo, Japan
  • 19:00 (UTC +09:00)
View GitHub Profile
<?php
class Foo
{
public function Foo()
{
var_dump(__METHOD__);
}
public function __construct()
{
var_dump(__METHOD__);
<?php
namespace PHP;
/**
* Array iterator like Ruby.
*
* @author Naoya Ito <i.naoya@gmail.com>
* licence: TBD
*/
class ListRubyLike
@heavenshell
heavenshell / Rest.php
Created December 17, 2010 15:08
RESTful Client library
<?php
/**
* Kyoto Tycoon's PHP RESTful client example.
*
* PHP version 5.2
*
* Copyright (c) 2010 Shinya Ohyanagi, All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

Class DateTime

.. php:method:: setDate($year, $month, $day)

    Set the date in the datetime object

    :param int $year: The year.
    :param int $month: The month.
    :param int $day: The day.
@heavenshell
heavenshell / gist:862157
Created March 9, 2011 13:10
Sphinx PHPDomain

Acceptance tests for PHPdomain

.. php:class:: DateTime

Globals

.. php:global:: $global_var
@heavenshell
heavenshell / gist:961142
Created May 8, 2011 05:35
unite.vim settings...
nnoremap [unite] <Nop>
nmap f [unite]
nnoremap [unite]u :<C-u>Unite<Space>
nnoremap <silent> [unite]f :<C-u>Unite -buffer-name=files file buffer file_mru<
CR>
nnoremap <silent> [unite]c :<C-u>UniteWithCurrentDir -buffer-name=files buffer
file_mru bookmark file<CR>
nnoremap <silent> [unite]o :<C-u>Unite outline<CR>
nnoremap <silent> [unite]O :<C-u>Unite outline -auto-preview<CR>
@heavenshell
heavenshell / gist:966682
Created May 11, 2011 15:30
Tiny benchmarks for Net::Riak
#!/usr/bin/env perl
use strict;
use warnings;
use Benchmark;
use Net::Okuyama;
use Net::Riak;
my $okuyama = Net::Okuyama->new(hosts => 'localhost:8888');
$okuyama->set('foo' => 'bar');
my $riak = Net::Riak->new(
@heavenshell
heavenshell / PHPUnit
Created May 17, 2011 15:56
Stagehand_Testrunner report
$ $ phpunit SampleTest.php
PHPUnit 3.5.13 by Sebastian Bergmann.
.FPHP Fatal error: Class 'Sampl' not found in /private/tmp/SampleTest.php on line 18
Fatal error: Class 'Sampl' not found in /private/tmp/SampleTest.php on line 18
@heavenshell
heavenshell / gist:978358
Created May 18, 2011 10:52
Silex error
<?php
require_once 'silex.phar';
$app = new Silex\Application();
$app->get('/', function () {
return 'index';
});
$app->get('/hello/{name}', function ($name = 'bar') {
@heavenshell
heavenshell / gist:978800
Created May 18, 2011 15:26
Silex WebTestCase
public function createApplication()
{
return require __DIR__.'/path/to/app.php';
}