Skip to content

Instantly share code, notes, and snippets.

View Olegas's full-sized avatar

Oleg Elifantiev Olegas

  • Russia, Yaroslavl
View GitHub Profile
@Olegas
Olegas / readme.md
Last active October 15, 2018 19:54
  1. Спецификация requestAnimationFrame: http://www.w3.org/TR/animation-timing/
  2. Справочник свойств, приводящих к reflow/restyle/repaint: http://csstriggers.com
  3. Ян Бородецкий, Оптимизация рендеринга веб-страницы: https://www.youtube.com/watch?v=-uMZDzIhcHQ
  4. 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
@Olegas
Olegas / amd.js
Created July 9, 2015 10:42 — forked from ipoddubny/amd.js
define(['cjs'], function (cjs) {
console.log('amd module loaded');
console.log('cjs exported:', cjs);
return 'AMD';
});
@Olegas
Olegas / Description.md
Last active August 29, 2015 14:22
Race condition in cluster RR scheduling
@Olegas
Olegas / demo.js
Created March 31, 2015 19:39
io.js worker disconnect bug
var cluster = require('cluster'),
net = require('net');
if (cluster.isMaster) {
console.log('Master started');
cluster.fork();
// Wait 10sec and disconnect worker
setTimeout(function(){
@Olegas
Olegas / 0-Description.md
Last active August 29, 2015 14:16
Read file stream line by line using generators
@Olegas
Olegas / bad.js
Created November 11, 2014 20:50
How code style affects code review
this.doWork({ amount: 6, unit: "hour" });
@Olegas
Olegas / autodoc.js
Last active August 29, 2015 14:09
How code style affects code review
{
/**
* Получить контрол по идентификатору.
* @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");
@Olegas
Olegas / gitlab-teamcity-integration
Created November 4, 2014 20:34
Custom script to integrate GitLab with TeamCity 8+
// 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}
@Olegas
Olegas / gist:9817229
Last active August 29, 2015 13:57
Monitor current focused element
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>'
@Olegas
Olegas / gist:9143277
Last active May 26, 2016 04:52
iOS hover-click problem solution.
/**
* 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');