Skip to content

Instantly share code, notes, and snippets.

@eduavila
eduavila / gist:97fdb02acd2a46e9663f
Created April 8, 2015 14:36
Response API - /api/contratos?include=pedidos&limit=1
{
"data": [
{
"id": 15,
"tipo": "venda",
"obs_interna": "teste",
"obs_pedido": "asdlsadlsaka",
"created_at": "30-01-2015 11:59:50",
"updated_at": "30-01-2015 11:59:50",
"entidade": {
$scope.removeItem = function(index){
if(!$scope.pedido.itens.data[index].id){
$scope.pedido.itens.data.splice(index, 1);
}else{
$scope.pedido.itens.data[index]._destroy = true;
}
};
<tr ng-repeat=item in pedido.itens.data | notViewDestroy">
<td>{{$index +1}}</td>
<td>{{item.produto.data.cod}}</td>
<td>{{item.produto.data.desc}}</td>
<td>{{item.dt_ini | date:'shortDate'}}</td>
<td>{{item.dt_fim | date:'shortDate'}}</td>
<td>{{item.tes.data.cod}}</td>
<td>{{item.produto.data.um}}</td>
@eduavila
eduavila / gist:da871ee00ffb4ec0feaf
Created February 1, 2016 20:15 — forked from TiuTalk/gist:1045708
Habilitando GZIP em servidores Nginx
# Habilita o gzip
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
# Mime-types que serão compactados
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
.directive('pfComobox', ["$timeout", function ($timeout) {
'use strict';
return {
restrict: 'A',
require: '?ngModel',
scope: {
selectPickerOptions: '=pfCombobox'
},
link: function (scope, element, attrs, ngModel) {
var optionCollectionList, optionCollection, $render = ngModel.$render;
angular
.module('app.directives')
.directive('selectEntidade',['$uibModal','$http',function($uibModal,$http) {
return {
restrict: 'E',
require: 'ngModel',
scope:{
result:"=",
ngModel: '=',
},
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eduavila
eduavila / Repository.cs
Created March 21, 2017 22:01 — forked from ChrisMcKee/Repository.cs
Generic Repository Interface and implementation. NHIBERNATE
namespace Core.Repository
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
public interface IRepository<T> where T : class
{
bool Add(T entity);
@eduavila
eduavila / ALTERNATIVES.adoc
Created June 21, 2017 05:08 — forked from mbbx6spp/ALTERNATIVES.adoc
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using NHibernate;
using NHibernate.Linq;
public interface IEntity<TIdentity>