Skip to content

Instantly share code, notes, and snippets.

View tchikuba's full-sized avatar

Tsutomu Chikuba tchikuba

View GitHub Profile
@tchikuba
tchikuba / assignment.php
Last active April 11, 2016 07:46
PHP代入演算子
<?php // 代入演算子
$a = 1;
print $a; // 1
// 参照による代入
$a = 1;
$b = &$a;
print $b; // 1
$a = 2;
print $b; // 2($aが変わったので$bも変化する)
@tchikuba
tchikuba / client.rb
Created May 20, 2015 08:18
td-client-rubyのqueryメソッドのインタフェース(2015/05/20時点)
# @param [String] db_name
# @param [String] q
# @param [String] result_url
# @param [Fixnum] priority
# @param [Fixnum] retry_limit
# @param [Hash] opts
# @return [Job]
def query(db_name, q, result_url=nil, priority=nil, retry_limit=nil, opts={})
# for compatibility, assume type is hive unless specifically specified
type = opts[:type] || opts['type'] || :hive
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
#!/bin/bash
# TODO: http://wiki.debian.org/LSBInitScripts
DESC="Selenium server"
RUN_AS=root
JAVA_BIN=/usr/bin/java
SELENIUM_DIR=/etc/selenium
PID_FILE="$SELENIUM_DIR/selenium.pid"