Skip to content

Instantly share code, notes, and snippets.

View afuggini's full-sized avatar

Ariel Fuggini afuggini

View GitHub Profile
@afuggini
afuggini / nginx.config
Created October 5, 2016 16:13 — forked from jakemmarsh/nginx.config
Modify nginx proxy settings in Elastic Beanstalk options
files:
"/tmp/proxy.conf":
mode: "000644"
owner: root
group: root
content: |
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
@afuggini
afuggini / extend.js
Created September 12, 2016 20:11
Vanilla object extend function (UnderscoreJS)
var extend = function() {
var extended = {};
for(key in arguments) {
var argument = arguments[key];
for (prop in argument) {
if (Object.prototype.hasOwnProperty.call(argument, prop)) {
extended[prop] = argument[prop];
}
}
var defaults = {
number: 1,
bool: true,
magic: 'real',
animal: 'whale',
croutons: 'delicious'
};
var options = {
number: 2,
// #1 ES6: if passing one argument you don't need to include parenthesis around parameter.
var kitty = name => name;
// same as ES5:
var kitty = function(name) {
return name;
};
// #2 ES6: no parameters example.
var add = () => 3 + 2;
@afuggini
afuggini / query.json
Last active October 15, 2015 19:46
How do I insert a new key:value set under one of the objects inside AdTagNames in MongoDB?
{
"_id" : ObjectId("541945c1a5b1e41035b49ed7"),
"AdTagNames" : [
{
"adURL" : "http://www.sdfadgs.com",
"adPASSBACK" : "http://google.com/passback.html",
"adTAGS" : [
"sdfgsdfgsdfg"
]
},

TL;DR

Meteor is great at sharing code between different builds for different platforms. You can use the same source for your browser builds, server builds, your builds for iOS, Android, ... But how to organize your project to be able to orchestrate your builds for different apps and services from the same source? This post elaborates on the reasons why you need these different builds and how you could accomplish this with Meteor easily.

Use cases: Why would you build different apps?

1. Different apps for different roles

Say you have an app with completely different end user experiences depending on their role. It is common practice to have the user logged in, check her authorization (role) and then setup different routes or load different templates to serve that type of user’s needs. While doing so, all types of users load the same build and the app decides what portions of the build to use and what not to use.

@afuggini
afuggini / config.json
Created April 16, 2015 14:26 — forked from anonymous/config.json
Untitled Project - Bootstrap Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
Router.configure
layoutTemplate: "MasterLayout"
loadingTemplate: "Loading"
notFoundTemplate: "NotFound"
Router.route "/",
name: "homepage"
Router.route "/files",
name: "files"
.factory('genericCollectionFactory',function(){
function Collection() {
var _items = [];
function get () {
return _items;
}
function add (item) {
@afuggini
afuggini / Error
Last active August 29, 2015 14:04
Angular DDP
Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
Error: [$injector:modulerr] Failed to instantiate module starter.controllers due to:
Error: [$injector:modulerr] Failed to instantiate module angularDDP due to:
Error...<omitted>...1)