Skip to content

Instantly share code, notes, and snippets.

View iakio's full-sized avatar

ISHIDA Akio iakio

View GitHub Profile
@iakio
iakio / jquery.cors.js
Created July 10, 2012 07:37 — forked from mewlist/jquery.cors.js
Cross-Origin Resource Sharing (CORS) for jQuery for IE8+
$.ajaxTransport("+*", function( options, originalOptions, jqXHR ) {
if(jQuery.browser.msie && window.XDomainRequest) {
var xdr;
return {
send: function( headers, completeCallback ) {
<?php
// Notice: Undefined property: Test::$data となる
class Test extends PHPUnit_Framework_TestCase
{
function setUp()
{
$this->data = array(
array(1, 1)
);
}
<?php
error_reporting(E_ALL | E_STRICT);
class C
{
public static $one = 1;
public $two = 2;
static function a() { echo "a\n"; }
function b() { echo "b\n"; }
}
ishida=# create function t(bool) returns bool as 'select true' language sql;
CREATE FUNCTION
ishida=# create aggregate exists_(*) (sfunc = t, stype = bool, initcond = false);
CREATE AGGREGATE
ishida=# select exists_(*) from pg_user;
exists_
---------
t
(1 row)
$ find path_to_sourcedir/ -name '*.php' > cscope.files
$ cscope -b
$ cat ~/.vimrc
...
if has('cscope')
nnoremap <Leader>s :<C-u>scs find s <C-R>=expand("<cword>")<CR><CR>
nnoremap <Leader>g :<C-u>scs find g <C-R>=expand("<cword>")<CR><CR>
nnoremap <Leader>c :<C-u>scs find c <C-R>=expand("<cword>")<CR><CR>
nnoremap <Leader>t :<C-u>scs find t <C-R>=expand("<cword>")<CR><CR>
*** gosu.cmd.org Wed Nov 10 07:36:46 2010
--- gosu.cmd Wed Nov 10 07:36:59 2010
***************
*** 21,28 ****
set _G_ROOT_DIR=%~dp0
set _G_CLASSPATH=
! FOR /R %_G_ROOT_DIR%\..\jars %%G IN (*.jar) DO set _G_CLASSPATH=!_G_CLASSPATH!;%%G
! FOR /R %_G_ROOT_DIR%\..\ext %%G IN (*.jar) DO set _G_CLASSPATH=!_G_CLASSPATH!;%%G
<?php
$arr = array(1);
function &a() {
global $arr;
return $arr[];
}
var_dump(a(), $arr);
var_dump(a(), $arr);
var_dump(a(), $arr);
syntax on
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set noexpandtab
set ambiwidth=double
set t_Co=256
set listchars=tab:^\ ,trail:<
set list
$ php -r 'echo "foo" . 2 * 5, "\n";'
foo10
$ php -r 'echo "foo" . 2 + 5, "\n";'
5
$ php -r 'var_dump(true <> 0 > 1);'
bool(true)
$ php -r 'var_dump(true != 0 > 1);'
bool(true)
$ php -r 'var_dump((true <> 0) > 1);'
ishida=# create function any_eq (anyelement, anyelement) returns boolean language sql as 'select $1 = $2';
CREATE FUNCTION
ishida=# create operator == (procedure = any_eq, leftarg=anyelement, rightarg=anyelement);
CREATE OPERATOR
ishida=# select 1+2 == 3;
?column?
----------
t
(1 row)