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
keltanas@kelbook:~/PycharmProjects/tornado/static$ ab -n 10000 -c 1000 http://localhost:8888/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient) | |
Completed 1000 requests | |
Completed 2000 requests | |
Completed 3000 requests | |
Completed 4000 requests |
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
__author__ = 'keltanas' | |
class closure: | |
def get_me(self): | |
return lambda : self | |
inst_test = closure() | |
me = inst_test.get_me() | |
del inst_test |
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 | |
class test | |
{ | |
public function do_test() | |
{ | |
return function() { | |
return $this; | |
}; | |
} | |
} |
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 5.2 | |
$cities = array_filter($cities,create_function('$v','return count($v);')); | |
// >= PHP 5.3 | |
$cities = array_filter($cities,function($v){return count($v);}); | |
// VS |
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 settingCONF_BYCOUNTRY_BYZONE_FORM($module_id) | |
{ | |
$curr_country = isset($_POST["shipping_module_bycountry_byzone_country"]) ? $_POST["shipping_module_bycountry_byzone_country"] : 0; | |
$curr_country = (int) $curr_country; | |
if(!$curr_country){ | |
$curr_country = xGetData('SXshipping_module_bycountry_byzone_country'.$module_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
<?php | |
/** | |
* Gravatar request example | |
* @author Nikolay Ermin <nikolay@ermin.ru> | |
* @link http://siteforever.ru | |
*/ | |
function exception_error_handler($errno, $errstr, $errfile, $errline ) { | |
throw new ErrorException($errstr, 0, $errno, $errfile, $errline); | |
} |
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
/** | |
* Плагин для twitter bootstrap, открывает dropdown меню при наведении, если оно находится внутри navbar | |
* <div class="navbar" id="menu1">...</div> | |
* <script type="javascript">$(document).ready(function(){ | |
* $('#menu1').dropdownMouse() | |
* });</script> | |
* @return {*} | |
*/ | |
$.fn.dropdownMouse = function() | |
{ |
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
for ( n=1; n<=3; n++ ){ | |
$.get( url, $.proxy( function( n, data ){ | |
console.log(arguments, n, data); | |
}, n)); | |
} |
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 | |
set_include_path($_SERVER['DOCUMENT_ROOT']); | |
require_once 'engine.php'; | |
// подключаем библиотеку | |
require_once('tcpdf/config/lang/rus.php'); | |
require_once('tcpdf/tcpdf.php'); | |
//require_once('../class/imo_account_pdf.php'); |
NewerOlder