Skip to content

Instantly share code, notes, and snippets.

View orlaqp's full-sized avatar

Orlando Quero orlaqp

View GitHub Profile
-- 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"
[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
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"
@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' }
}
});
/**
* 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,
/**
* Send transfer information to the server
*
* @method save
**/
save: function() {
var that = this, d = $q.defer();
this._prepareProductsPayload();
if (this.id) {
(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) {
# 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 })
@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
<div class="ui green message">
This location is going to be active until: {{justDate model.activeUntil}}
{{> button caption="Extend" class="mini renew location" icon="money"}}
<form action="" method="POST">
<script
src="https://checkout.stripe.com/v2/checkout.js" class="stripe-button"
data-key="my-test-key-goes-here"
data-amount="2000"
data-name="Demo Site"