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
var idLevel = 9999; | |
var config = null; | |
function getIdLevel(id) { | |
if (id == 1 || id == 3) return 0; | |
if (id == 2 || id == 4) return 1; | |
return 2; | |
} | |
for (var i : items) { |
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 s($a) { | |
return preg_replace('/(?=\d.*\d.*\d.*\d.*\d)(\d)/', '*', $a); | |
} | |
echo s('A1BC23D5678'); // A*BC**D5678 | |
echo s('A1BC233D5Df6G78'); // A*BC***D5Df6G78 | |
echo s('A1212B24543C233D5Df6G78dgag'); // A****B*****C***D5Df6G78dgag |
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
<pre class="lang:php"> | |
function leonax_anti_spam_form($fields){ | |
global $leonax_magic_lower, $leonax_magic_upper; | |
$leonax_magic = mt_rand($leonax_magic_lower, $leonax_magic_upper); | |
$fields['leonax_magic'] = <<<EOT | |
<input type="hidden" id="leonax-magic" name="leonax-magic" value="0"> | |
<script type="text/javascript"> | |
jQuery(function() { | |
jQuery("#comment").on("keyup", function() { | |
jQuery("#leonax-magic").val("$leonax_magic"); |
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
package { | |
import flash.display.*; | |
import flash.text.*; | |
public dynamic class listButton extends MovieClip { | |
public var description:TextField; | |
public var image:MovieClip; | |
public var shade:MovieClip; | |
public var title:TextField; |
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
var myName = 'Sumhat'; | |
var myEmail = 'sumhat@gmail.com'; | |
var myUrl = 'http://leonax.net'; | |
function fillForm(blogIdSelector, authorSelector, urlSelector, emailSelector) { | |
if (blogIdSelector != null) { | |
var blogId = document.querySelector(blogIdSelector); | |
if (blogId == null) { | |
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
<link rel="canonical" href="<?php echo "http://leonax.net".strtok($_SERVER["REQUEST_URI"],'?'); ?>"/> | |
<?php | |
if ( is_singular() ) { | |
echo '<link rel="author" href="https://plus.google.com/+ShuhaiShenSumhat"/>'; | |
} | |
?> |
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(/.*)?)$:将所有.php结尾的URL都交给PHP-FPM处理 | |
# 127.0.0.1:9000:PHP-FPM的服务端 | |
# /var/www/html/$1:网站源文件所在路径 | |
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/html/$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
; 开启OPCache的命令行支持 | |
opcache.enable_cli=1 | |
; 设置缓存失效时间为60秒 | |
opcache.revalidate_freq=60 |
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
/** | |
* Returns a public cache with advanced cache support; | |
*/ | |
function getPublicCache() { | |
return new AdvancedCache(CacheService.getPublicCache()); | |
} | |
/** | |
* Returns a private cache with advanced cache support; | |
*/ |
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:Get-Data { | |
Param ( | |
[Parameter(ParameterSetName="ByInt", Position=0)] [int] $intData, | |
[Parameter(ParameterSetName="BySwitch", Position=0)] [switch] $boolData, | |
[Parameter(ParameterSetName="ByArray", Position=0)] [string[]] $arrayData | |
) | |
Write-Host $PsCmdlet.ParameterSetName | |
} |
NewerOlder