Skip to content

Instantly share code, notes, and snippets.

View Gozala's full-sized avatar
😱
Oh well

Irakli Gozalishvili Gozala

😱
Oh well
View GitHub Profile
@Gozala
Gozala / sdk_strawman.js
Created October 10, 2012 11:01 — forked from jeffgca/sdk_strawman.js
content script apis ideas
// Content scripts will be able to require modules, only
// high level ones that are E10S friendly and can do
// everything via data that is serialize.
$(function() {
// what we have now
self.on('event-name', function(data) {
// ... something
});
self.port.emit('something');
@Gozala
Gozala / javascript_background_thread.js
Created September 19, 2012 01:53 — forked from jameswomack/javascript_background_thread.js
Extend function prototype to run a function as a WebWorker
Function.prototype.runOnBackgroundThread = function (aCallback) {
var _blob = new Blob(['onmessage = '+this.toString()],{"type":"text/javascript"});
var _worker = new Worker((webkitURL.createObjectURL || URL.createObjectURL)(_blob));
_worker.onmessage = aCallback;
_worker.postMessage();
}
var _test = function () {
postMessage((1+1).toString());
}
// Here is a proposal for minimalist JavaScript classes(?), that does not
// introduces any additional syntax to the language, instead it standardizes
// approach already used by majority of JS frameworks today.
// !!! What is a PROBLEM!!!
function Dog(name) {
// Classes are for creating instances, calling them without `new` changes
// behavior, which in majority cases you need to handle, so you end up with
// additional boilerplate.
@Gozala
Gozala / README.md
Created October 27, 2009 20:30 — forked from Gozala/meta-docs.patch
metadocs

Idea of documenting js code inspired by python and EcmaScript 5 "strict mode"; Works on narwhal, firefox, chromium, safari (not tested on ie)

Below is the example of usage in this in the the shell

gozala@ijarti:~/Projects/meta-doc  (master)$ narwhal
Rhino 1.7 release 3 PRERELEASE 2009 04 05
js> require("meta-doc/toolkit").doc()
toolkit module
provides utilities for getting a live docs