This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Controller | |
Insc.findById('55db841e16f87bd00bfec6df').populate('orderInsc.items.insc').exec(function(err, insc){ | |
console.log('insc', insc); | |
}); | |
// Models | |
var InscSchema = new Schema({ | |
orderInsc: { | |
type: Schema.Types.ObjectId, | |
ref: 'Order' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
total = 0; | |
items = [{ | |
produto: id, | |
qty: x | |
}] | |
para cada item - | |
- verificar plano | |
- {fee: x, liquid: x} | |
- subtotal = fee * item.qty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="search-wrapper" search-box> | |
<input /> | |
<button ng-click="vm.search()"></button> | |
</div> | |
'use strict'; | |
angular.module('core.utils').directive('searchBox', /*@ngInject*/ function() { | |
return { | |
scope: {}, | |
controller: 'SearchBoxCtrl', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jwt = require('jsonwebtoken'); | |
var _ = require('lodash'); | |
var secret = 'RS#$09qu43f09qfj94qf*&H#(R'; | |
var refreshSecret = 'rw5&&$$2224124f*&H#(R'; | |
var bcrypt = require('bcrypt'); | |
/** | |
* UserController | |
* | |
* @description :: Server-side logic for managing users |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* REGISTER CONTROLLER */ | |
import Ember from 'ember'; | |
import EmberValidations from 'ember-validations'; | |
export | |
default Ember.Controller.extend(EmberValidations, { | |
validations: { | |
'model.firstName': { | |
presence: true | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cep: function() { | |
var vm = this, | |
cep = vm.get('model.cep'); | |
getCep(cep); | |
function getCep(cep) { | |
if (!cep) { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cep: function() { | |
var vm = this, | |
cep = vm.get('model.cep'); | |
cepApi(cep); | |
function cepApi(cep) { | |
if (!cep) { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function atualizacep(cep){ | |
cep = cep.replace(/\D/g,"") | |
url="http://cep.correiocontrol.com.br/"+cep+".js" | |
s=document.createElement('script') | |
s.setAttribute('charset','utf-8') | |
s.src=url | |
document.querySelector('head').appendChild(s) | |
} | |
function correiocontrolcep(valor){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
SUM(CASE WHEN FIND_IN_SET('ingles:basico', index_idiomas) THEN 1 ELSE 0 END) AS ingles_basico, | |
SUM(CASE WHEN FIND_IN_SET('ingles:intermediario', index_idiomas) THEN 1 ELSE 0 END) AS ingles_intermediario, | |
SUM(CASE WHEN FIND_IN_SET('ingles:fluente', index_idiomas) THEN 1 ELSE 0 END) AS ingles_fluente, | |
SUM(CASE WHEN FIND_IN_SET('espanhol:basico', index_idiomas) THEN 1 ELSE 0 END) AS espanhol_basico | |
FROM | |
esbox_production.default_bc_index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// URL DE ACESSO: http://provedor/seleciona/brindes | |
// Retorna um JSON com o total de brindes, data e hora | |
{ | |
total_brindes: "100", | |
data: "24/03/2015", | |
hora: "15:05" | |
} |