Skip to content

Instantly share code, notes, and snippets.

View kreshikhin's full-sized avatar
🏠
Working from home

Denis Kreshikhin kreshikhin

🏠
Working from home
View GitHub Profile
require 'zbase32'
require 'translit'
class Product
include MongoMapper::Document
@@semaphore = Mutex.new
key :url, String # ???
key :origin_url, String
;function Model(){
this.selected = ko.observable(false);
this.excluded = ko.observable(false);
this.changed = ko.observable(false);
this.detectChanges = ko.observable(true);
this.deactivated = ko.observable(false);
};
Model.prototype.select = function(){ this.selected(true); };
Model.prototype.unselect = function(){ this.selected(false); };
;function Product(data, parent){
var self = this;
$.extend(self, new Model());
self.id = ko.observable("#id");
// model properties
self.title = ko.observable("#title");
self.article = ko.observable("#article");
self.brand = ko.observable("#brand");
// warning! bad code style!
var z = a + b + c + d;
// correct way
var z = (function(){
return a + (function(){
return b + (function(){
return c + (function(){
return (function(){