Skip to content

Instantly share code, notes, and snippets.

@kolombet
kolombet / cloudSettings
Created September 3, 2019 12:20
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-09-03T12:20:08.322Z","extensionVersion":"v3.4.2"}
@kolombet
kolombet / AutoCaptureGLThing.js
Created July 15, 2017 12:26 — forked from gre/AutoCaptureGLThing.js
example that render things offscreen with gl-react – would love if you find a way to make this use-case less hacky
class AutoCaptureGLThing extends Component {
onRef = exportable => {
if (!exportable || this.exporting) return;
this.exporting = true;
exportable.captureFrame(/* see https://projectseptemberinc.gitbooks.io/gl-react/content/docs/api/Surface.html */)
.then(path => { // oops back to node callback pattern via props callback
this.props.onCapture(null, path);
}, error => {
this.props.onCapture(error);
});
@kolombet
kolombet / what-forces-layout.md
Created April 11, 2017 13:16 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@kolombet
kolombet / promisesEM.md
Created June 22, 2016 14:10 — forked from dmvaldman/promisesEM.md
Promises as EventEmitters

Promises as EventEmitters

I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.

I read the spec, some blog posts, and looked through some code. I learned how to

@kolombet
kolombet / embeds.js
Created December 10, 2015 17:32
generate embeds
/**
* Составляет embed из выбранной директории
*/
if (process.argv.length <= 2) {
console.log("Usage: " + __filename + " path/to/directory");
process.exit(-1);
}
var fs = require("fs");
var path = require("path");
We couldn’t find that file to show.
@kolombet
kolombet / atomConfig.test
Created December 10, 2015 12:35
atomConfig
123
//stage.nativeWindow.maximize();
//var options:NativeWindowInitOptions = new NativeWindowInitOptions();
//options.systemChrome = NativeWindowSystemChrome.STANDARD;
//options.resizable = true;
//options.maximizable = true;
//var window:flash.display.NativeWindow = new flash.display.NativeWindow(options);
//var rootModule:DisplayObject = stage.getChildAt(0);
//stage.removeChild(rootModule);
//
@kolombet
kolombet / GovnoCode.as
Created November 26, 2015 08:02
GOVNOCODE
if (_chain[0][4] != null)
{
createCompressedImage(_chain[0][0], _chain[0][1], _chain[0][2], _chain[0][3], _chain[0][4]);
_chain.shift();
return;
}
var current:AssetsLibrary = _chain[0][0];
if (_chain[0][4] != null)
current.parseData(ByteArray(new _chain[0][1]()).readObject());
else
@kolombet
kolombet / filewalker.js
Created November 25, 2015 16:29
LUKE FILEWALKER resursivly scan directory and create output
var walk = require('walk');
var files = [];
// Walker options
var walker = walk.walk('./', { followLinks: false });
var fs = require('fs');
walker.on('file', function(root, stat, next) {
files.push(stat.name);
next();