This file contains 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
MyAppMobile.angular.service('ParametrosService', ['$rootScope', function ($rootScope) { | |
'use strict'; | |
return { | |
parametros: {nome: '', valor: ''}, | |
refresh: function() { $rootScope.$broadcast('refresh_parametros'); } | |
}; | |
}]); | |
This file contains 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
$scope.parametros = ParametrosService.parametros; | |
$scope.Titulo = $scope.parametros.nome; | |
console.log('FiltroPageCtrl'); | |
console.log($scope.parametros); | |
$scope.goURL = function (v_url) { | |
$window.location.href = v_url; | |
}; |
This file contains 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
MyAppMobile.angular.factory('FiltroService', ['$document', '$http', function ($document, $http) { | |
'use strict'; | |
var destaques = {}, | |
eventListeners = { | |
'produtoClicked': [] | |
}; | |
destaques.addEventListener = function (eventName, callback) { | |
eventListeners[eventName].push(callback); |
This file contains 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
MyAppMobile.angular.controller('FiltroPageController', ['$scope', '$http', '$window', 'InitService', | |
'ParametrosService', 'FiltroService', | |
function ($scope, $http, $window, InitService, ParametrosService, FiltroService) { | |
'use strict'; | |
$scope.parametros = ParametrosService.parametros; | |
$scope.Titulo = $scope.parametros.nome; | |
This file contains 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
MyAppMobile.angular.controller('CategoriaPageController', ['$scope', '$http', '$window', 'InitService', | |
'CategoriaListService', 'ParametrosService', | |
function ($scope, $http, $window, InitService, CategoriaListService, ParametrosService) { | |
'use strict'; | |
$scope.goURL = function (v_url) { | |
ParametrosService.parametros.nome = 'params'; | |
ParametrosService.parametros.valor = 'cat=' + v_url; | |
console.log(ParametrosService.parametros); |
This file contains 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
MyAppMobile.angular.factory('ParametrosService', ['$document', '$http', function ($document, $http) { | |
'use strict'; | |
return { | |
parametros: { | |
nome: '', | |
valor: '' | |
} | |
}; |
This file contains 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
import re | |
def merge_dicts(*dicts): | |
# http://stackoverflow.com/questions/7204805/dictionaries-of-dictionaries-merge | |
if not reduce(lambda x, y: isinstance(y, dict) and x, dicts, True): | |
raise TypeError("Object in *dicts not of type dict") | |
if len(dicts) < 2: | |
raise ValueError("Requires 2 or more dict objects") |
This file contains 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
#!/usr/bin/env bash | |
curl -X POST http://local.enota.com.br:8000/api/assinatura/iugu/retornoboleto/ --data "'data[id]': ['83A0C50B5A0A43AD8F60C1066B16A163'], 'data[status]': ['paid'], 'event': ['invoice.status_changed']" |
This file contains 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
@require_http_methods(['POST']) | |
@csrf_exempt | |
def get_iugu_retorno(request): | |
d1 = request.POST | |
d2 = d1.get('data[id]') |
This file contains 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
{% extends 'base/base.html' %} | |
{% load staticfiles %} | |
{% load i18n %} | |
{% load account %} | |
{% load url from future %} | |
{% load socialaccount %} | |
{% block conteudo %} | |
<div class="row"> | |
<div class="col-md-4"></div> |