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 | |
use Doctrine\ORM\Persisters; | |
class DoctrineHelper | |
{ | |
protected $entityManagers = array(); | |
public function bulkCommit(EntityManager $em, array $entities) | |
{ |
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
DROP TABLE IF EXISTS company; | |
CREATE TABLE company ( | |
id INT(11) NOT NULL AUTO_INCREMENT, | |
title VARCHAR(255) NOT NULL, | |
rating INT(11) NOT NULL, | |
is_paid TINYINT(1) NOT NULL, | |
PRIMARY KEY (id) | |
) | |
ENGINE = INNODB; | |
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
/* <div class="main-header">...</div> - плохо */ | |
.main-header:after, | |
.main-header .top-panel-inner:after, | |
.main-menu-list:after, | |
.wrapper:after, | |
.main-footer .footer-inner:after, | |
.category-title:after, | |
.products-list:after, | |
.checkout-form:after, | |
.product-title:after, |
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
#!/usr/bin/php | |
<?php | |
$processUser = posix_getpwuid(posix_geteuid()); | |
$name = $processUser['dir'].'/mail/'.date('Y-m-d H:i:s').'-'.microtime(true).'.eml'; | |
if (!is_dir($dir = dirname($name))) { | |
mkdir($dir, 0777, true); | |
} | |
$fh = fopen($name, "w"); | |
if (!$fh) { | |
die(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
// An example controller binded to the form | |
function FormCntl($scope, $compile) { | |
// Consider using FosJsRouting bundle, if you want to use a Symfony2 route | |
$scope.formUrl = "http://url-to-fetch-my-form"; | |
// Data from the form will be binded here | |
$scope.data = {}; | |
// Method called when submitting the form | |
$scope.submit = 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
$el.typeahead({ | |
minLength: 2, | |
autoselect: true, | |
hint: false, | |
highlight: true | |
}, { | |
source: function(query, cb) { | |
suggestSource.ttAdapter()(query, function(items) { | |
var filteredItems = []; | |
angular.forEach(items, function(item) { |
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
// ==UserScript== | |
// @name Google Open Search Result In Nes Tab | |
// @version 0.1 | |
// @author Konstantin Myakshin | |
// @grant none | |
// | |
// @include *://www.google.*/*q=* | |
// @include *://www.google.*/*tbs=* | |
// @include *://www.google.*/search?* | |
// @include *://www.google.*/webhp?* |
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
metalloprokat@metalloprokat1:/data/www/metalloprokat.ru$ sudo cat /var/log/apache2/metalloprokat.ru-access.log | cut -d " " -f 1 | sort | uniq -c | sort -g -r | head -50 | |
[sudo] password for metalloprokat: | |
5583374 10.1.142.101 10.1.142.101 | |
58697 130.193.48.24 spider-130-193-48-24.yandex.com | |
58246 37.140.141.49 spider-37-140-141-49.yandex.com | |
57944 5.255.253.105 spider-5-255-253-105.yandex.com | |
57170 5.255.253.191 spider-5-255-253-191.yandex.com | |
55781 95.108.158.184 spider-95-108-158-184.yandex.com | |
51520 5.255.253.153 spider-5-255-253-153.yandex.com |
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
metalloprokat@metalloprokat1:/data/www/metalloprokat.ru$ curl -I http://www.metalloprokat.ru/sort/armatura/ | grep X-Exec-Time | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 | |
X-Exec-Time: 20ms | |
metalloprokat@metalloprokat1:/data/www/metalloprokat.ru$ curl -I http://www.metalloprokat.ru/sort/armatura/a1/ | grep X-Exec-Time | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 | |
X-Exec-Time: 34ms |
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
area_id | priority | lat | lng | |
---|---|---|---|---|
772 | 0 | 55.78552753 | 37.56576486 | |
772 | 1 | 55.79135504 | 37.57389732 | |
772 | 2 | 55.79157265 | 37.57430501 | |
772 | 3 | 55.79164217 | 37.57455178 | |
772 | 4 | 55.79169355 | 37.57479854 | |
772 | 5 | 55.79173935 | 37.57511471 | |
772 | 6 | 55.79176108 | 37.57543070 | |
772 | 7 | 55.79175012 | 37.57754328 | |
772 | 8 | 55.79180074 | 37.58024493 |