A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
/** | |
* Плагин для twitter bootstrap, открывает dropdown меню при наведении, если оно находится внутри navbar | |
* <div class="navbar" id="menu1">...</div> | |
* <script type="javascript">$(document).ready(function(){ | |
* $('#menu1').dropdownMouse() | |
* });</script> | |
* @return {*} | |
*/ | |
$.fn.dropdownMouse = function() | |
{ |
<?php | |
use Money\Money; | |
/** | |
* Class VatCalculatingService | |
* Calculating VAT | |
* | |
* @see: http://www.achievertalk.com/achievertalkwp/2011/06/vat-in-your-young-enterprise-company/ | |
*/ | |
class VatCalculatingService |
<?php | |
# http://seyferseed.ru/ru/php/kastomnaya-strategiya-gerenatsii-id-v-doctrine-2.html#sthash.r0n7nj05.dpbs | |
print 'orig: 581a8775b67e88-ca53-8b4568' . PHP_EOL; | |
print 'comp: ' . uniqid('', false) . dechex(mt_rand(0, 0xF)) . '-' . dechex(getmypid()) . '-' . dechex(mt_rand(0, 0xFFFFFF)) . PHP_EOL; |
#!/usr/bin/env python | |
# | |
# Vkontatke OAuth 2.0 wrapper | |
# Copyright 2011, Adil Khashtamov [adil.khashtamov@gmail.com] | |
# http://khashtamov.kz | |
# | |
# | |
import logging |
<?php | |
namespace Linkofy\CommonBundle\Menu; | |
use Knp\Menu\FactoryInterface; | |
use Symfony\Component\DependencyInjection\ContainerAware; | |
class Builder extends ContainerAware | |
{ | |
public function mainMenu(FactoryInterface $factory, array $options) |
Это вставить например, в "верхняя часть сайта" | |
<a href="#" id="blind">Версия</a> | |
<script> | |
$(function(){ | |
$('#blind') // ссылается на <a href="#" id="blind"></a> | |
.click(function(){ | |
$('body').toggleClass('blind'); | |
return false; |
A list of amazingly awesome PHP libraries, resources and shiny things.
// Шаг 1 | |
function(){} // объявляем анонимную функцию | |
// Шаг 2 | |
(function(){})(); // - объявляем и запускаем анонимную функцию | |
// Шаг 3 | |
(function($){ |
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 |
__author__ = 'keltanas' | |
class closure: | |
def get_me(self): | |
return lambda : self | |
inst_test = closure() | |
me = inst_test.get_me() | |
del inst_test |