Skip to content

Instantly share code, notes, and snippets.

View mrzafod's full-sized avatar
🎯
Focusing

Roman mrzafod

🎯
Focusing
  • Tbilisi, Georgia
View GitHub Profile
# dboperator
class DBOperator extends Factory.ExtClass
constructor: (@_collection) ->
@_selector = {}
@_options = {}
@_modifier = {}
where: (args...) ->
for arg in args
class ManagedSub
constructor: (name, options = {}) ->
self = @
self.sub = null
enter = ->
options.enter?()
# bind self.enter - it runs once per call
self.enter = _.once enter
@mrzafod
mrzafod / designer.html
Created December 24, 2014 09:55
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@mrzafod
mrzafod / test.js
Created May 6, 2014 05:39
Meteor.js local collection change hooks
var Layers = App.Collection('layers');
Layers.find().observeChanges({
'added': function (id, fields) {
var doc = this.results._map[id];
// now we could access and modify the doc
// ---------------------------------------------------------------------
// here I wanna know a type of the layer and then fill some default
// properties for doc
@mrzafod
mrzafod / compiler.js
Created April 30, 2014 03:58
improvement for meteor-jade/plugin/compiler.js
// ----------------------------------------------------------------------------
// THIS ALLOWS YOU TO DEFINE JADE SYNTAX AS FOLLOW
// ----------------------------------------------------------------------------
// rules: you can use a helper inside jade with brackets, you can pass any arguments (i.e. another helpers) inside brackets
// Samples:
// +if anyHelper(arg1, arg2, arg3, ...)
// div(class=anyHelper(arg1, arg2, arg3, ...))
// h1= anyHelper(arg1, arg2, arg3, ...)
// h1 #{anyHelper(arg1, arg2, arg3, ...)}
// ----------------------------------------------------------------------------