This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table t | |
( | |
id int auto_increment not null primary key, | |
parent_id int, | |
in_seq_num int | |
); | |
// parent_id 内の連番を in_seq_num に入れたい | |
set @lastid := 0; | |
set @number := 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
preg_match('/^([^ ]*) ([^ ]*) ([^ ]*) \[([^]]*)\] "([^ ]*)(?: *([^ ]*) *([^ ]*))?" ([^ ]*) ([^ ]*) "(.*?)" "(.*?)"/', $buf, $log_stat); | |
list($all, $host, $ident, $user, $time, $method, $resource, $proto, $status, $bytes, $referer, $agent) = $log_stat; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Ex1 { | |
private function private_method($val1 , $val2) { | |
return func_get_args(); | |
} | |
} | |
$obj = new Ex1(); | |
$r = call_private_method($obj, 'private_method', 'test1', 'test2'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copy_row($fromid, $overwride = array()) { | |
$fom = $this->db->getTable('table')->find($fromid); | |
$to = $this->db->getTable('table')->create(); | |
$to->fromArray(array_merge($overwride, $from->toArray())); | |
$to->save(); | |
} | |
$new_row = copy_row(1, array('id' => null)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$response = parent::render(); | |
$response->setContent(str_replace('a','b',$response->getContent())); | |
return $reponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function assertInuptValue($crawler, $key, $val) | |
{ | |
$input = $crawler->filter('input[name="'.$key.'"]'); | |
$this->assertEquals( | |
$val, $input->attr('value'), $key.' failed' | |
); | |
} | |
protected function assertSelectValue($crawler, $key, $val) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# usage: | |
# git current で現在のブランチ名を表示する | |
git branch | grep '*' | sed 's/* //' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name chatwork to all helper | |
// @match https://www.chatwork.com/* | |
// @version 1.1 | |
// ==/UserScript== | |
(function(){ | |
document.getElementById('cw_chattext').addEventListener('blur', function(e){ | |
if (/[@@]{2}/.test(e.target.value)) { | |
var to_list = []; | |
var imgs = document.getElementById('cw_mention_gallery').getElementsByTagName('img'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr> | |
<td>storeEval</td> | |
<td>this.page().getDocument().forms[0]['enc'].value</td> | |
<td>enc</td> | |
</tr> | |
<tr> | |
<td>assertValue</td> | |
<td>name=enc</td> | |
<td>${enc}</td> | |
</tr> |
OlderNewer