Skip to content

Instantly share code, notes, and snippets.

View orlaqp's full-sized avatar

Orlando Quero orlaqp

View GitHub Profile
@orlaqp
orlaqp / gist:b8d5aa7dc0ae8feab98c
Last active August 29, 2015 14:15
Meteor publication messages
// from the DDP analyzer I have this
{"msg":"sub","id":"iYudq8vMomLjhiScY","name":"clients","params":["N9e24k7wzMW6YvknW"]}
{"msg":"nosub","id":"iYudq8vMomLjhiScY","error":{"error":"unauthorized","reason":"You do not have access to this location","message":"You do not have access to this location [unauthorized]","errorType":"Meteor.Error"}}
# server
Meteor.publish 'clients', (locationId) ->
# @ready() unless SecurityContext.checkAccessBeforePublish.apply this, [locationId]
if SecurityContext.canAccessLocation @userId, locationId
# server publish
Meteor.publish 'clients', (locationId) ->
# @ready() unless SecurityContext.checkAccessBeforePublish.apply this, [locationId]
if SecurityContext.canAccessLocation @userId, locationId
@ready()
@error new Meteor.Error('unauthorized', 'You do not have access to this location')
return
ClientManagement.Collections.Clients.find({ locationId: locationId }, { sort: firstName: 1 })
(function() {
'use strict';
var app = angular.module('nova'),
factoryId = 'dashboardFactory';
app.factory(factoryId, ['$rootScope', 'config', 'common', 'Restangular', '$q', dashboardClass]);
function dashboardClass($rootScope, config, common, restangular, $q) {
/**
* Send transfer information to the server
*
* @method save
**/
save: function() {
var that = this, d = $q.defer();
this._prepareProductsPayload();
if (this.id) {
/**
* This funtion takes care of instantiate the right transfer object depending on which paramters
* were passed into $stateParams
*
* @private
* @method _resolveTransfer
**/
function _resolveTransfer() {
var d = $q.defer(),
workflow = $stateParams.workflow,
@orlaqp
orlaqp / business model serializer
Last active August 29, 2015 14:07
Issue with polymorphic relationships in ember
import DS from 'ember-data';
export default DS.ActiveModelSerializer.extend(DS.EmbeddedRecordsMixin, {
attrs: {
// contacts: { embedded: 'always' },
// addresses: { embedded: 'always' }
contacts: { serialize: 'records' },
addresses: { serialize: 'records' }
}
});
INFO global: Vagrant version: 1.6.5
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/bin/vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: VAGRANT_LOG="debug"
[2014-10-05 14:22:33.372] ERROR Adhearsion::Call: 8ff7b858-4cbc-11e4-ad03-9f5a4ee1a688@127.0.0.1: <Adhearsion::CallController::Output::PlaybackError> Output failed due to #<Adhearsion::Error: : #<Punchblock::Component::Output target_call_id="8ff7b858-4cbc-11e4-ad03-9f5a4ee1a688", target_mixer_name=nil, component_id="output-4", source_uri="xmpp:8ff7b858-4cbc-11e4-ad03-9f5a4ee1a688@127.0.0.1/output-4", domain="127.0.0.1", transport=nil, timestamp=Sun, 05 Oct 2014 14:22:33 -0400, request_id="ccacc18c-f041-4c21-9e8d-daab3a40af11", voice=nil, interrupt_on=nil, start_offset=nil, start_paused=nil, repeat_interval=nil, repeat_times=nil, max_time=nil, renderer=nil, render_documents=[#<Punchblock::Component::Output::Document target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Sun, 05 Oct 2014 14:22:33 -0400, url=nil, content_type="application/ssml+xml", value=<speak xmlns="http://www.w3.org/2001/10/synthesis" version="1.0" xml:lang="en-US">0 times wrong, try
-- vars.xml
<!-- Rayo settings -->
<X-PRE-PROCESS cmd="set" data="rayo_ip=127.0.0.1"/>
<X-PRE-PROCESS cmd="set" data="rayo_domain_name=$${rayo_ip}"/>
-- adhearsion.rb
config.punchblock.platform = :xmpp # Use FreeSWITCH
config.punchblock.username = "usera@127.0.0.1"
**/usr/local/freeswitch/mod/mod_v8.so: cannot open shared object file: No such file or directory**
2014-10-05 14:04:34.343812 [DEBUG] switch_loadable_module.c:1398 Loading module with global namespace at request of module
2014-10-05 14:04:34.343846 [NOTICE] switch_loadable_module.c:227 Adding Dialplan 'LUA'
2014-10-05 14:04:34.343873 [NOTICE] switch_loadable_module.c:269 Adding Application 'lua'
2014-10-05 14:04:34.343906 [NOTICE] switch_loadable_module.c:292 Adding Chat Application 'lua'
2014-10-05 14:04:34.343948 [NOTICE] switch_loadable_module.c:315 Adding API Function 'luarun'
2014-10-05 14:04:34.343976 [NOTICE] switch_loadable_module.c:315 Adding API Function 'lua'
2014-10-05 14:04:34.344295 [NOTICE] switch_loadable_module.c:471 Adding Say interface 'en'
2014-10-05 14:04:34.344477 [DEBUG] mod_event_socket.c:2883 Socket up listening on 127.0.0.1:8021
2014-10-05 14:04:34.344459 [DEBUG] switch_loadable_module.c:702 Chat Thread Started