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 | |
/** | |
* @see http://www.php.net/manual/en/features.commandline.io-streams.php | |
*/ | |
$input = fgets(STDIN,4096); |
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 | |
add_filter('show_password_fields', create_function('$a', "return 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
<?php | |
$url = 'http://www.yahoo.co.jp'; | |
$user_agent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)"; | |
$opts = array( | |
'http' => array( | |
'method' => 'GET', | |
'user_agent' => $user_agent, | |
)); | |
$context = stream_context_create($opts); |
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
/** | |
* 月を指定してwp_get_archivesを呼び出します | |
* @see common-sidebar.php | |
* @see wp-includes/general-template.php wp_get_archives() | |
*/ | |
if ( ! function_exists( 'my_custom_post_type_archive_where' ) ) { | |
function my_custom_post_type_archive_where( $where, $args ){ | |
if ($args['type'] != 'monthly') | |
return $where; |
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
<mt:setvarblock name="relation_parts"><mt:blogsitepath><$MTEntryDate format="%Y/%m"$>/<mt:entrybasename extension="0" separator="-">_rel.html</mt:setvarblock> | |
<mt:var name="search" value="0"> | |
<mt:ifstraightsearch><mt:var name="search" value="1"></mt:ifstraightsearch> | |
<mt:iftagsearch><mt:var name="search" value="1"></mt:iftagsearch> | |
<mt:if name="search" eq="0"> | |
<?php | |
ini_set('display_errors', false); | |
$file = ''; | |
$file = "<mt:getvar name="relation_parts">"; | |
echo "<!--" . $file . "-->"; |
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
#!/opt/local/bin/python2.7 | |
import os | |
import shutil | |
f = open('cp.sh', 'r') | |
for line in f: | |
f = line.rstrip("\n") | |
d = "2014060302/" + os.path.dirname(line) | |
print f | |
#print d | |
shutil.copy(f, d) |
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
# coding: utf-8 | |
require 'open-uri' | |
require 'nokogiri' | |
url = "http://test.localhost/abc.plugin.html" | |
charset = nil | |
html = open(url) do |f| | |
charset = f.charset | |
f.read |
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 | |
/** | |
* ssi | |
*/ | |
function smarty_function_ssi($params, &$smarty) | |
{ | |
if (empty($params['file'])) return ''; | |
if (empty($params['ssi_enc'])) 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
$query = $this->Post->getQuery('all', array( | |
'conditions' => array('Post.id' => array(1,2,3,4,5), | |
'fields' => array('Post.id'), | |
)); | |
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() { | |
$("#search > div > div.box.f-left > ul > li > input.genre").each(function() { | |
$(this).prop('checked', true); | |
if (!$(this).next().next().find('input:checkbox').prop('checked')) { | |
$(this).prop('checked', false); | |
} | |
}); | |
$("#search > div > div.box.f-left > ul > li > input.genre").bind('change', function() { | |
$(this).next().next().find('input:checkbox').prop('checked', this.checked); | |
}); |
OlderNewer