This file contains hidden or 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 | |
// via : http://d.hatena.ne.jp/hasegawayosuke/20130302/p1 | |
function checkHasegawaCsrf() { | |
$host = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : null; | |
$xFrom = isset( $_SERVER['HTTP_X_FROM'] ) ? $_SERVER['HTTP_X_FROM'] : null; | |
$origin = isset( $_SERVER['HTTP_ORIGIN'] ) ? $_SERVER['HTTP_ORIGIN'] : null; | |
if ( $host === null ) { |
This file contains hidden or 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 | |
require_once '/path/to/tmhOAuth/tmhOAuth.php'; | |
$obj = new tmhOAuth( array( | |
'consumer_key' => 'consumer_key', | |
'consumer_secret' => 'consumer_secret', | |
'user_token' => 'access_token', | |
'user_secret' => 'access_token_secret', | |
) ); |
This file contains hidden or 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
<!DOCTYPE HTML> | |
<html lang="ja-JP"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes, target-densityDpi=medium-dpi" /> | |
<meta name="format-detection" content="telephone=no" /> | |
<title>noscript test</title> | |
</head> | |
<body> |
This file contains hidden or 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 | |
$out = shell_exec( 'ffmpeg -i sample.mp4 2>&1' ); | |
preg_match( '/(\d+\.\d+|\d+)\s*fps/', $out, $match ); | |
print_r( $match ); | |
// Array | |
// ( | |
// [0] => 29.98 fps | |
// [1] => 29.98 | |
// ) |
This file contains hidden or 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 | |
/** | |
* animate | |
* @param array $files | |
* @param string $out | |
* @param int $delay 切り替えmsec default 50 | |
* @param int $loop ループ回数, 0で無限ループ default 1 | |
* @param boolean $autoreverse 自動リバースするかどうか default false | |
* @param float $resize_percent リサイズ% default 1.0 | |
* @param integer $quality 1 が最低, 255が最高 default 128 |
This file contains hidden or 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 | |
/** | |
* Transloadit.php | |
*/ | |
/** | |
* Transloadit class | |
* | |
* usage: | |
* |
This file contains hidden or 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
'import_http_files' => array( | |
'robot' => '/http/import', | |
'url' => array( | |
'http://cdn-ak.f.st-hatena.com/images/fotolife/m/mgng/20130130/20130130125239.png', | |
'http://cdn-ak.f.st-hatena.com/images/fotolife/m/mgng/20130130/20130130105748.png', | |
), | |
), | |
↓ |
This file contains hidden or 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
<!DOCTYPE HTML> | |
<html lang="ja-JP"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="apple-itunes-app" content="app-id=333903271"> | |
<title>smart app banners test</title> | |
</head> | |
<body> | |
<script type="text/javascript">alert(1);</script> | |
<noscript>javascript off</noscript> |
This file contains hidden or 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 | |
session_start(); | |
$xml = new SimpleXMLElement('<root />'); | |
$_SESSION['xml'] = $xml; | |
// Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'SimpleXMLElement' is not allowed' in [no active file]:0 | |
// Stack trace: | |
// #0 {main} | |
// thrown in [no active file] on line 0 |
This file contains hidden or 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 | |
// Lambda Face API サンプル | |
require_once "./face-php-client/Face.php"; | |
$public_key = 'メモった Public Key'; | |
$private_key = 'メモった Private Key'; | |
$img_url = '画像のURL'; | |
// 認証 |