- Спецификация requestAnimationFrame: http://www.w3.org/TR/animation-timing/
- Справочник свойств, приводящих к reflow/restyle/repaint: http://csstriggers.com
- Ян Бородецкий, Оптимизация рендеринга веб-страницы: https://www.youtube.com/watch?v=-uMZDzIhcHQ
- Avoid Large, Complex Layouts and Layout Thrashing https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing#avoid-forced-synchronous-layouts
This file contains hidden or 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
| define(['cjs'], function (cjs) { | |
| console.log('amd module loaded'); | |
| console.log('cjs exported:', cjs); | |
| return 'AMD'; | |
| }); |
Starting from createServer: https://github.com/nodejs/io.js/blob/master/lib/net.js#L884
Adding subscription to ‘connection’ event: https://github.com/nodejs/io.js/blob/master/lib/net.js#L1066
When listen is called, we are going here: https://github.com/nodejs/io.js/blob/master/lib/net.js#L1353
Cause’ we are worker, we’ll request a server: https://github.com/nodejs/io.js/blob/master/lib/net.js#L1254
_getServer is sending a message to master https://github.com/nodejs/io.js/blob/master/lib/cluster.js#L542
This file contains hidden or 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 cluster = require('cluster'), | |
| net = require('net'); | |
| if (cluster.isMaster) { | |
| console.log('Master started'); | |
| cluster.fork(); | |
| // Wait 10sec and disconnect worker | |
| setTimeout(function(){ |
A follow-up to http://yarfrontend.ru/talks/es6-generators/.
Goals:
- Iterate over readable stream, line by line, using generators.
- Write async code in synchronous way but hide implementation details as much as possible
Async wrapper live demo: http://jsfiddle.net/Olegas/v8Lujpr8/4/
This file contains hidden or 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
| this.doWork({ amount: 6, unit: "hour" }); |
This file contains hidden or 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
| { | |
| /** | |
| * Получить контрол по идентификатору. | |
| * @param {String} id Идентификатор искомого контрола. | |
| * @return {$ws.proto.Control} Найденный контрол. | |
| * @deprecated Используйте $ws.proto.AreaAbstract.getChildControlByName | |
| */ | |
| get : function(id){ | |
| if (this._storage[id] === undefined) | |
| throw new Error("ControlStorage : id = '" + id + "' not stored"); |
This file contains hidden or 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
| // Configuration. GitLab API key, API url | |
| var CIParams = { | |
| gitlabKey: 'YOURSECREKAPIKEY', | |
| gitlabApiUrl: 'https://gitlab/api/v3/', | |
| tcApiUrl: '/guestAuth/app/rest/', | |
| tcProtocol: 'https://' | |
| }, | |
| cachedData = { | |
| currentProject: {id: -1}, | |
| currentMergeRequest: {id: -1} |
This file contains hidden or 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 current = null; | |
| $('<div />', { | |
| html: '<style>@-webkit-keyframes changeopacity { from { opacity: 1 } to { opacity: 0.2 } }\ | |
| .indicate { -webkit-animation-duration: 0.25s; -webkit-animation-name: changeopacity; -webkit-animation-iteration-count: infinite; -webkit-animation-direction: alternate; }\ | |
| .focus-mark-container { outline: 1px dotted red; }\ | |
| .focus-target-log { position: absolute; left: 0; top: 30px; background: blue; color: white; z-index: 20000 }\ | |
| .tabindex-indicator { z-index: 100000; opacity: 0.3; position: absolute; left: 0; top: 0; background: blue; color: white }\ | |
| .tabindex-indicator-current { background: red; }\ | |
| </style>' |
This file contains hidden or 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
| /** | |
| * Solution for http://stackoverflow.com/questions/21786375/ios-7-hover-click-issue-no-click-triggered-in-some-cases | |
| */ | |
| $(document).ready(function(){ | |
| if (/* if this is not iOS */) { | |
| return; | |
| } | |
| var $body = $('body'); |