Skip to content

Instantly share code, notes, and snippets.

View hamaguchi's full-sized avatar

xxxx hamaguchi

  • Yokohama, Japan
View GitHub Profile
@hamaguchi
hamaguchi / gist:3859558e2ef15dd817fb
Last active August 29, 2015 14:12
FuelPHPでパスワードとパスワード確認をValidationでやる方法
$val = Validation::forge();
$password = Input::post('password');
$confirm_password = Input::post('confirm_password');
$val->add('password', 'パスワード')
->add_rule('trim')
->add_rule('required')
->add_rule('min_length', 8)
->add_rule('max_length', 16)
@hamaguchi
hamaguchi / gist:c7ff168689d8b902ca14
Created January 21, 2015 06:32
GoogleAnalytics_track
/**
* GoogleanAlyticsトラッキングを、PHPで強引に送信する
*
* @param type $long_url
* @param type $title
* @param type $remote_addr
* @param type $http_user_agent
*/
public static function googleanalytics_track($long_url, $title, $remote_addr, $http_user_agent)
{
// $date = "Tue, 20 Jan 2015 12:20:53 +0900"
// $sdate = "2013-08-25T17:00:00+00:00"
$tpdate = new DateTime($date);
$sdate = $tpdate->format('Y-m-d\TH:i:s');
@hamaguchi
hamaguchi / gist:7925cdac57dcc116ae14
Last active August 29, 2015 14:14
simplexml_load_string の謎...
set_error_handler(function($errno, $errstr, $errfile, $errline) {
throw new \Exception($errstr, $errno);
});
try {
$search = array("\0", "\x01", "\x02", "\x03", "\x04", "\x05","\x06", "\x07", "\x08", "\x0b", "\x0c", "\x0e", "\x0f");
$options = array(
'http' => array(
'method' => 'GET',
@hamaguchi
hamaguchi / gist:cb6acf435ddfe469d2a7
Created February 6, 2015 05:36
PHP simplexml_load_string のエラーハンドリングを一生懸命やる!
function getXmlData($rss_url = NULL) {
set_error_handler(function($errno, $errstr, $errfile, $errline) {
throw new Exception($errstr, $errno);
});
try {
$search = array("\0", "\x01", "\x02", "\x03", "\x04", "\x05","\x06", "\x07", "\x08", "\x0b", "\x0c", "\x0e", "\x0f");
$options = array(
'http' => array(
auto eth1
iface eth1 inet static
address 172.16.1.2
netmask 255.255.0.0
network 172.16.0.1
broadcast 172.16.255.255
auto eth1
iface eth1 inet static
address 172.16.1.1
netmask 255.255.0.0
network 172.16.0.1
broadcast 172.16.255.255
@hamaguchi
hamaguchi / file0.php
Last active August 29, 2015 14:17
[PHP] Google Analytics のアクセス偽装方法を実装してみる [FuelPHP] ref: http://qiita.com/makoto1899/items/b15bc608484a19c0a48e
/**
* GoogleanAlyticsトラッキングを、PHPで強引に送信する
*
* @param type $long_url
* @param type $title
* @param type $remote_addr
* @param type $http_user_agent
*/
public static function googleanalytics_track($long_url, $title, $remote_addr, $http_user_agent)
{
@hamaguchi
hamaguchi / file0.txt
Last active August 29, 2015 14:17
Ubuntu14.04TLSで、MySQL 5.5から5.6(Oracle版)にアップデートしたら、FuelPHPでエラーが出た時の対処法 ref: http://qiita.com/makoto1899/items/607daf2e266d39e413b0
Fuel\Core\Database_Exception [ Warning ]:
mysqli::mysqli(): Headers and client library minor version mismatch. Headers:50540 Library:50622
wp s3-uploads migrate-attachments --url=acmilan.f14s.xyz
wp s3-uploads enable --url=acmilan.f14s.xyz