Skip to content

Instantly share code, notes, and snippets.

View mrzafod's full-sized avatar
🎯
Focusing

Roman mrzafod

🎯
Focusing
  • Tbilisi, Georgia
View GitHub Profile
@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, ...)}
// ----------------------------------------------------------------------------
@matb33
matb33 / collection-hooks.js
Last active December 15, 2015 12:09
Collection hooks for Meteor: allows you to run callbacks before and after any insert/update/remove to collections. Works across both server and client. Drop this file into a shared folder, for example: `/lib/external/collection-hooks.js`
MOVED: https://github.com/matb33/meteor-collection-hooks