Skip to content

Instantly share code, notes, and snippets.

<?php
function rsum($v, $w)
{
$v += $w;
return $v;
}
function rmul($v, $w)
{
$v *= $w;
<?php
//BAD PHP runs out of memory on 120 iterations
public function fire()
{
set_time_limit(0);
DB::connection('mongodb')->disableQueryLog();
<?php namespace InfinitiWeb\Services;
use XMLReader;
use DOMDocument;
class AdmitADYMLParserService {
private $xml_reader = null;
private $offer = null;
# Èíäåêñàöèÿ îôôåðîâ
source discash_offers : base_conect
{
#sql_query_range = SELECT MIN(id), MAX(id) FROM offers
#sql_range_step = 500
sql_query = \
SELECT id, name , description , internal_id, updated_at, 'offer' as model_name \
FROM offers
<?php
return array (
'host' => '127.0.0.1',
'port' => 9312,
'indexes' => array (
'discash_offers' => array ( 'table' => 'offers', 'column' => 'id' ),
'discash_products' => array ( 'table' => 'products', 'column' => 'id' ),
)
);
<?php
/*
* Locale checker
*/
\App::setLocale('ru');
$languages = array('ru', 'en', 'ua', 'by', 'kz', 'md');
$locale = Request::segment(1);
<script>
/*jslint unparam: true */
/*global window, $ */
$(function () {
'use strict';
// Change this to the location of your server-side upload handler:
function removeErrorLabels() {
$('label.error-message').remove();
}
$scope.specialist.photoUrl = false;
//Workaround for issue described here: https://issues.apache.org/jira/browse/CB-7131
var imgLoadErr = function () {
$scope.specialist.photoUrl = false;
};
var img = new Image();
img.onerror = imgLoadErr;
img.onabort = imgLoadErr;
img.onload = function () {
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
{
"generator-gulp-angular": {
"version": "0.11.0",
"props": {
"angularVersion": "~1.3.4",
"angularModules": [
{
"key": "animate",
"module": "ngAnimate"
},