import requests
Python Web Scraping
Update MYSQL Definers - All at once
show procedure status where Db <> 'DatabaseName' and Definer = 'localuser@%';
SET SQL_SAFE_UPDATES = 0;
update mysql.proc set definer='localuser@%'
where definer='root@localhost' and db =
'DatabaseName' ;
SET SQL_SAFE_UPDATES = 1;
Moment: Creating datefield with knockout
ko.bindingHandlers.datepicker = {
init: function(element, valueAccessor, allBindingsAccessor) {
var $el = $(element);
//initialize datepicker with some optional options
var options = allBindingsAccessor().datepickerOptions || {};
$el.datepicker(options);
//handle the field changing
ko.utils.registerEventHandler(element, "change", function() {
var observable = valueAccessor();
observable($el.datepicker("getDate"));
});
//handle disposal (if KO removes by the template binding)
ko.utils.domNodeDisposal.addDisposeCallback(element, function() {
$el.datepicker("destroy");
});
},
update: function(element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor()),
$el = $(element),
current = $el.datepicker("getDate");
if (value - current !== 0) {
$el.datepicker("setDate", value);
}
}
};
<input class="form-control" data-bind="datepicker:paidon"/>
self.paidon = ko.observable(new Date());