var app = require('express')();
var bodyParser = require('body-parser');
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.post('/data', function (req, res) {
console.log(req.body);
res.end();
});
app.listen(3000);
<?php
1)
$videoLength = $video->addText('videoLength', 'Délka videa');
$videoLength->addConditionOn($form['article-published'], Form::EQUAL, TRUE)
->setRequired();
$videoLength->addCondition(Form::FILLED)
->addRule(Form::PATTERN
2)
$video->addText('videoLength', 'Délka videa')
->addConditionOn($form['article-published'], Form::EQUAL, TRUE)
->setRequired()
->endCondition()
->addCondition(Form::FILLED)
->addRule(Form::PATTERN, 'Délka musí být zadána ve formátu minuty:sekundy', '[0-9]+:[0-9]{2}');
<?php
->addCondition(function() use ($form) {
return ...; //true nebo false
})
<?php
$fileUpload = new \Nette\Http\FileUpload([
'name' => basename($filePath),
'size' => filesize($filePath),
'tmp_name' => $filePath,
'error' => UPLOAD_ERR_OK,
]);
$('#wrapper div').mouseover(function(){
$(this).children('span').addClass('active');
$(this).prevAll().children('span').addClass('active')
});
$('#wrapper div').mouseout(function(){
$(this).prevAll().children('span').removeClass('active')
$(this).children('span').removeClass('active');
});
CREATE TRIGGER trRaiseTopicCountAll
AFTER INSERT ON forum_commentary
FOR EACH ROW
BEGIN
UPDATE forum_topic
SET forum_commentary_count_all = @forum_commentary_count_all +1
WHERE forum_topic_id = NEW.forum_topic_id;
IF (NEW.commentary_parent_id IS NULL)
THEN
UPDATE forum_topic
SET first_commentary_id = NEW.forum_commentary_id
WHERE forum_topic_id = NEW.forum_topic_id;
END IF;
END;
CREATE TRIGGER trRaiseTopicCountVisible
AFTER UPDATE ON forum_commentary
FOR EACH ROW
BEGIN
IF (OLD.forum_commentary_status_id <> NEW.forum_commentary_status_id)
THEN
IF (NEW.forum_commentary_status_id = 2)
THEN
UPDATE forum_topic
SET forum_commentary_count_visible = @forum_commentary_count_visible +1
WHERE forum_topic_id = NEW.forum_topic_id;
ELSE
UPDATE forum_topic
SET forum_commentary_count_visible = @forum_commentary_count_visible -1
WHERE forum_topic_id = NEW.forum_topic_id;
END IF;
END IF;
END;
1)
var Abc = function(aProperty,bProperty){
this.aProperty = aProperty;
this.bProperty = bProperty;
this.init = function(){
// Do things here.
}
this.init();
};
var currentAbc = new Abc(obj,obj);
2)
var Abc = function(aProperty,bProperty){
function privateInit(){ console.log(this.aProperty);}
this.aProperty = aProperty;
this.bProperty = bProperty;
privateInit.apply(this);
};
3)
var Abc = function(aProperty,bProperty){
this.aProperty = aProperty;
this.bProperty = bProperty;
//init
(function () {
// Perform some operation
}.call(this));
};
var currentAbc = new Abc(obj,obj);
$(document).ready(function () {
animate([$('#one'), $('#two'), $('#three')], finished);
});
function finished() {
$('body').append('Finished');
}
function animate(list, callback) {
if (list.length === 0) {
callback();
return;
}
$el = list.shift();
$el.animate({left: '+=200'}, 1000, function () {
animate(list, callback);
});
}