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
.DS_Store | |
Thumbs.db | |
.svn | |
.buildpath | |
.project | |
.settings | |
*.swp | |
.idea | |
.vagrant |
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 | |
$speakers = ['@voidofglans', '@mkkn_info', '@cloned', '@tanakahisateru', '@sizuhiko', '@shoichi4411', '@77web', '@hhatto']; | |
$count = 10; | |
echo "\n"; | |
for ($i = 0; $i < $count; $i++) { | |
echo "シャッフル!!\n"; | |
shuffle($speakers); | |
sleep(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
<!-- コメントボックスを表示したいところにこれを置く --> | |
<script> | |
(function(){ | |
var ua = navigator.userAgent; | |
if (ua.indexOf('iPhone') == -1 | |
&& ua.indexOf('iPad') == -1 | |
&& ua.indexOf('iPod') == -1 | |
&& ua.indexOf('Android') == -1) { | |
document.write('<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-num-posts="10"></div>'); | |
} |
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
<script type="text/javascript"> | |
$('form').submit(function() { | |
$(this).submit(function () { | |
return false; | |
}); | |
}); | |
</script> |
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 | |
$timestamp = strtotime('2012-11-04'); | |
$format = SUNFUNCS_RET_TIMESTAMP; | |
$latitude = 33.590383; | |
$longitude = 130.423992; | |
$sunriseTimestamp = date_sunrise($timestamp , $format, $latitude, $longitude); | |
$sunriseDateTime = date('H:i:s', $sunriseTimestamp); | |
echo $sunriseDateTime; //06:40:03 |
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 | |
//Facebook SDK for PHP の src/ にあるファイルを | |
//サーバ内の適当な場所にコピーしておく | |
require_once('php-sdk/facebook.php'); | |
$config = array( | |
'appId' => '[取得した App ID]', | |
'secret' => '[取得した App Secret]' | |
); |
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
/** | |
* Google ドキュメントのフォームから投稿があったら確認メールを自動返信する(日本語版) | |
* English version will be available later. | |
* | |
* @author Masunaga Ray ( http://www.msng.info/ ) | |
* @instruction http://www.msng.info/archives/2012/04/google-docs-auto-reply.php | |
*/ | |
function sendConfirmation() { | |
try { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); |
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
/** | |
* Google ドキュメントのフォームから投稿があったら確認メールを自動返信する(日本語版) | |
* English version will be available later. | |
* | |
* @author Masunaga Ray ( http://www.msng.info/ ) | |
* @instruction http://www.msng.info/archives/2012/04/google-docs-auto-reply.php | |
*/ | |
function sendConfirmation() { | |
//フォームでメールアドレスが入力される列の名前 | |
var emailColName = "メールアドレス"; |
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 | |
//Requires function is_hankaku() https://gist.github.com/2167287 | |
function is_zenkaku($str, $encoding = null) { | |
if (is_null($encoding)) { | |
$encoding = mb_internal_encoding(); | |
} | |
$len = mb_strlen($str, $encoding); | |
for ($i = 0; $i < $len; $i++) { | |
$char = mb_substr($str, $i, 1, $encoding); | |
if (is_hankaku($char, true, true, $encoding)) { |
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 | |
function is_hankaku($str, $include_kana = false, $include_controls = false, $encoding = null) { | |
if (!$include_controls && !ctype_print($str)) { | |
return false; | |
} | |
if (is_null($encoding)) { | |
$encoding = mb_internal_encoding(); | |
} | |
if ($include_kana) { |