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
mysql -u root -D ‘yourdatabase’ -e “UPDATE wp_posts SET post_content=’`cat your-local-file.html | perl -i -pe “s/’/\\\\\\’/g”`’ WHERE ID=6826" |
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
SELECT * FROM `yourdatabase`.wp_posts WHERE post_status=’publish’ order by post_date DESC |
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
/* | |
* ----------------------------------------------------------------------------------------------------------------------- | |
* Sirvoy Booking Widget, (c) Sirvoy Ltd 2014, All rights reserved. | |
* ----------------------------------------------------------------------------------------------------------------------- | |
* | |
* Usage: | |
* | |
* To include the booking widget on your page, just add the following html to your page: | |
* <script async type="text/javascript" src="https://secured.sirvoy.com/widget/sirvoy.js" data-form-id="your-token-here"></script> | |
* |
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
// Based on https://code.google.com/p/google-diff-match-patch/wiki/LineOrWordDiffs. | |
diff_match_patch.prototype.diff_linesToWords_ = function(text1, text2) { | |
var lineArray = []; | |
var lineHash = {}; | |
lineArray[0] = ''; | |
function diff_linesToCharsMunge_(text) { | |
var chars = ''; | |
var lineStart = 0; |
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
/** | |
On touch devices we have an intertial scroll effect (also called momentum scroll) | |
that is hard to detect (with scrollTop property for example). | |
See this article for problem details http://andyshora.com/mobile-scroll-event-problems.html | |
Still it is possible to detect inertial scroll by calculating velocity | |
with which user is scrolling element. | |
In this gist we use velocity formula from this article: | |
http://ariya.ofilabs.com/2013/11/javascript-kinetic-scrolling-part-2.html |
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
var server = sinon.fakeServer.create(); | |
server.autoRespond = true; | |
Object.defineProperty(server, 'autoRespondAfter', { | |
get: function() { | |
if (someSmartCondition) { | |
return 100; | |
} | |
return 10; |
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
@main[] ^header[Создание плаката ко Дню независимости Украины (2014)] ^maindir[] | |
^include[../../holidays.p] | |
^tabs_poster_son[] | |
^include[../../ukraine-independence-day.p] | |
^tabs_son[] | |
Создание плаката ко Дню независимости Украины (2014) | |
^include[../auto.p] |
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
describe('do not reset model status to ok if it was in error status', function() { | |
beforeEach(function() { | |
ns.Model.define('model1'); | |
ns.Model.define('model2'); | |
this.xhr = sinon.useFakeXMLHttpRequest(); | |
this.xhr.onCreate = function(xhr) { | |
window.setTimeout(function() { | |
xhr.respond( |
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
describe('redraw old view when model was invalidated', function() { | |
// https://github.com/yandex-ui/noscript/pull/192#issuecomment-33148362 | |
// После починки _unbindModels перестало работать обновление view при изменении модели. | |
// Дело тут в том, что view подписана на своим модели. Модель поменялась - view перерисовалась (model ns-model-changed -> view invalidate). | |
// Когда мы починили отписку view от модели (во время _hide) изменения модели больше не будут услышаны view (что, как бы, хорошо и by design). | |
// Но тогда, во время update-а надо проверять, что все модели view валидны. И если нет - обновлять view. | |
// Итог: не отписываем view от моделей | |
var goToPage = function(app, params, callback) { |
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
var lw = { | |
wrap: function(type, onlyOwnProperties) { | |
for (var key in type) { | |
if (typeof type[key] === 'function') { | |
if (onlyOwnProperties && !type.hasOwnProperty(key)) { | |
continue; | |
} | |
(function(methodName) { | |
var _method = type[methodName]; |