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 | |
/** | |
* @var $world FeatureContext | |
*/ | |
$steps->Given( '/^"([^"]*)" でアクセスしている$/', function ( $world, $table ) { | |
switch ( $table ) { | |
case "フィーチャフォン": | |
$user_agent = "KDDI-CA39 UP.Browser/6.2.0.13.1.5 (GUI) MMP/2.0"; | |
break; | |
case "スマートフォン": |
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
# ログインしてクッキー抽出 | |
def login(mail, pass) | |
host = 'secure.nicovideo.jp' | |
path = '/secure/login?site=niconico' | |
body = "mail=#{mail}&password=#{pass}" | |
https = Net::HTTP.new(host, 443) | |
https.use_ssl = true | |
https.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
response = https.start { |https| |
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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
if RUBY_VERSION < '1.9' | |
require 'rubygems' | |
end | |
require File.expand_path('../../config/boot', __FILE__) | |
require 'json' | |
require 'mechanize' | |
require 'cgi' |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<project name="auoneLibrary" basedir="." default="all"> | |
<property name="outputDir" value="."/> | |
<target name="phpcpd"> | |
<phpcpd minTokens="10"> | |
<fileset dir="./application/"> | |
<include name="**/*.php"/> | |
<exclude name="library/lwopenid/**/*.php"/> | |
</fileset> |
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 CommonValidator | |
{ | |
/** | |
* 日付のフォーマット配列 | |
*/ |
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 CommonFormatter | |
{ | |
/** | |
* 日付のフォーマット配列 | |
*/ | |
private static $DATE_FORMAT_ARRAY = array( |
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 | |
if (defined('E_DEPRECATED')) { | |
error_reporting(E_ALL & ~E_DEPRECATED & ~E_WARNING); | |
} else { | |
error_reporting(E_ALL); | |
} | |
defined('APPLICATION_CONFIG') | |
|| define('APPLICATION_CONFIG', 'application.ini'); |
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
<div class="navbar navbar-inverse"> | |
<div class="navbar-inner"> | |
<a href="" class="brand">Logo</a> | |
<ul class="nav"> | |
<li><a href="" class="active">Home</a></li> | |
<li><a href="">Help</a></li> | |
</ul> | |
<form class="navbar-search pull-left"> | |
<input type="text" class="search-query" placeholder="検索"> | |
</form> |
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 hideAddressBar () { | |
setTimeout(function(){ | |
window.scrollTo(0,1); | |
}, 1); | |
} |
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 getScreenSize() { | |
var obj = new Object(); | |
if (!isSafari && !isOpera) { | |
obj.x = document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth; | |
obj.y = document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight; | |
} else { | |
obj.x = window.innerWidth; | |
obj.y = window.innerHeight; | |
} | |
obj.mx = parseInt((obj.x)/2); |
OlderNewer