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 | |
/** | |
* Zip code | |
*/ | |
add_filter('usces_filter_after_zipcode', 'my_usces_filter_after_zipcode', 10, 2); | |
function my_usces_filter_after_zipcode($zip, $applyform) { | |
if ($applyform === 'JP') { | |
$zip = '000-0000'; | |
} | |
return $zip; |
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 separateText($parent, tagName) { | |
$parent.children().addBack().contents().each(function() { | |
if (this.nodeType == 3) { | |
$(this).replaceWith($(this).text().replace(/(\S)/g, '<'+tagName+'>$1</'+tagName+'>')); | |
} | |
}); | |
} |
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
/** | |
* Copy | |
* Don't use for input tags | |
* | |
* e.g. | |
* <span id="copy-target">Copied text</span> | |
* <button class="copy-button" data-target="#copy-target">Copy</button> | |
*/ | |
$('.copy-button').on('click', function (e) { | |
e.preventDefault(); |
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
// ex. $sp-width: 768px | |
@import 'param'; | |
.entry-block { | |
/** | |
* Hyeading | |
*/ | |
h2, h3, h4, h5, h6 { | |
margin: 1.4em 0 .5em; | |
font-weight: bold; |
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 | |
// Convert Movie URL | |
function getMovieUrl($movieUrl) | |
{ | |
// Convert YouTube Url | |
if ( | |
strpos($movieUrl, 'youtu.be') !== false || | |
strpos($movieUrl, 'youtube.com/watch') !== false | |
) { |
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( global, U ) { | |
"use strict"; | |
// 必要条件に満たしていなければ終了 | |
if ( | |
! Element.prototype.addEventListener || | |
! document.querySelector | |
) { | |
return; | |
} |
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
/** | |
* admin-media.js | |
* | |
* @author SUSH <sush@sus-happy.ner> | |
*/ | |
( function( $, U ) { | |
$( function() { | |
var target = $( '.custom-media' ); | |
// 対象要素がなければ終了 |
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 | |
$to = '09012345678'; // 送信先 | |
// ログイン後のダッシュボードに記載されている情報を入れる | |
$user_id = 'dummy_user_id'; | |
$auth_token = 'dummy_auth_token'; | |
// Twilioで購入した番号を入力 | |
$from = '+18*********'; |
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
$ export LC_ALL=C | |
$ hhvm --mode daemon -vServer.Type=fastcgi -vServer.Port=9000 |
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
# ... | |
upstream php-backend { | |
# server unix:/path/to/php-fpm.socket; php-fpmの場合 | |
# server unix:/var/run/hhvm/sock; socket経由だと何故か動かず… | |
server 127.0.0.1:9000; | |
} | |
# ... |
NewerOlder