Skip to content

Instantly share code, notes, and snippets.

View gabrielhpugliese's full-sized avatar

Gabriel H Pugliese gabrielhpugliese

View GitHub Profile
@gabrielhpugliese
gabrielhpugliese / tracking.js
Last active August 29, 2015 13:56
Change preventTracking function to match your requirements of dev env
trackWoopra = function (name, options) {
// woopra
var user = Meteor.user(),
identification = {};
if (Meteor.user()) {
identification = {
name: user.profile.name,
email: user._id
};
HelpRequests = new Meteor.Collection('helpRequests', {
transform: function (doc) {
doc.isCancelled = function () {
return _.contains(['cancel-requester', 'cancel-helper'], this.status);
}
return doc;
}
});
<script type="text/javascript">
//<![CDATA[[
$SA = {s:204243, asynch: 1};
(function() {
var sa = document.createElement("script");
sa.type = "text/javascript";
sa.async = true;
sa.src = ("https:" == document.location.protocol ? "https://" + $SA.s + ".sa" : "http://" + $SA.s + ".a") + ".siteapps.com/" + $SA.s + ".js";
var t = document.getElementsByTagName("script")[0];
t.parentNode.insertBefore(sa, t);
// COMO VC TEM Q FAZER:
Meteor.users.find().forEach(function (doc) {
if (doc.profile && doc.profile.phoneNumber) {
timmy++;
} else if (doc.profile && doc.profile.postCode && doc.stripe) {
kenny++;
}
});
/*****************************************************************************/
Books = new Meteor.Collection("books", {
schema: {
title: {
type: String,
label: "Title",
max: 200
},
author: {
type: String,
label: "Author",
@gabrielhpugliese
gabrielhpugliese / app.js
Last active August 29, 2015 14:05
Trying to find a good way to append Blaze templates to custom divs
$(function() {
$.each(Template, function (name, tmpl) {
if (name.indexOf('__') === -1) {
UI.insert(UI.render(tmpl), $('#' + name + '-spacebars').get(0));
}
});
});
Template.main.rendered = function () {
var self = this;
_.defer(function () {
self.$('div').plugin();
});
};
// ou tenta isso:
Template.main.rendered = function () {
DetalheAnuncioIndexController = RouteController.extend({
waitOn: function () {
Meteor.subscribe('users');
return Meteor.subscribe('listarAnuncios');
},
data: function () {
return Anuncios.findOne(this.params.id);
},
@gabrielhpugliese
gabrielhpugliese / SassMeister-input.scss
Created March 3, 2015 14:49
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
.btn { color: white;}
.btn-primary { color: blue; }
.btn-disabled { color: grey; }
.simple-form {
define(function (require) {
'use strict';
var React = require('react');
var _ = require('underscore');
var DragDropMixin = require('react-dnd').DragDropMixin;
var ItemTypes = require('components/ItemTypes');
var dragSource = {
beginDrag: function (component) {