Skip to content

Instantly share code, notes, and snippets.

@haruta
haruta / maxlength.html
Created January 31, 2013 07:51
galaxy nexus で maxlenght値=value値の長さ のフォームの場合フォームに対して一切入力できなくなるっぽい。
<html>
<body>
<form action="" method="post">
exists maxlength: <input type="text" name="age" value="99" maxlength="2" /><br />
textarea: <textarea name="test"></textarea><br />
not exists maxlength: <input type="text" name="zip" value="" /><br />
</form>
</body>
</html>
<?php
class YmLinerTest
{
public function test(array $array)
{
sort($array);//一応ソート
$date = new DateTime($array[0].'01');
foreach ($array as $ym) {
if ($date->format('Ym') != $ym) return false;
mysql> desc (SELECT * FROM users WHERE email_pc='[email protected]' AND deleted=0) UNION (SELECT * FROM users WHERE email_mobile='[email protected]' AND deleted=0) \G
*************************** 1. row ***************************
id: 1
select_type: PRIMARY
table: users
type: const
possible_keys: email_pc
key: email_pc
key_len: 264
ref: const,const
@haruta
haruta / gist:5411458
Created April 18, 2013 09:33
add_hidden.php
<html>
<head>
<script language="javascript" type="text/javascript">
window.onload = function() {
var forms = document.getElementsByTagName('form');
for (var i = 0; i < forms.length; i++) {
var new_hidden = document.createElement('input');
new_hidden.type= 'hidden';
new_hidden.name = "input_key";
new_hidden.value = document.getElementById('input_key_source').value;
@haruta
haruta / gist:7557db295adede302a5d
Last active August 29, 2015 14:06
youtube で loop 再生させる
document.getElementsByTagName('video')[0].addEventListener('ended', function(e){ e.target.play(); });
@haruta
haruta / video_controls_layout_ng.html
Last active August 29, 2015 14:14
なんか、Android の標準ブラウザ(私が確認したのは ARROWS A 202F と Xperia A SO-04E) でなぜか video タグの controls が input タグに対する CSS の width と height の設定が効いちゃうんだけど、そういうもんなの。。。
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<style>
input {
/* なぜか この CSS が当たってるっぽく、レイアウトが崩れる */
height: 40px;
width: 100%;
}