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 { NgModule, Component, NgModuleRef, ApplicationRef, Type } from '@angular/core' | |
import { CommonModule, APP_BASE_HREF, LocationStrategy, HashLocationStrategy } from '@angular/common' | |
import { RouterModule, Routes } from '@angular/router' | |
import { BrowserModule, enableDebugTools } from '@angular/platform-browser' | |
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' | |
/** | |
* AppComponent | |
*/ | |
@Component({selector: 'my-component', template: `Hello World`}) | |
class AppComponent{} |
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
const { resolve } = require('path'); | |
/** | |
* Resolve tsconfig.json paths to Webpack aliases | |
* @param {string} tsconfigPath - Path to tsconfig | |
* @param {string} webpackConfigBasePath - Relative base path from tsconfig to Webpack config to create absolute aliases | |
* @return {object} - Webpack alias config | |
*/ | |
function resolveTsconfigPathsToAlias({ | |
tsconfigPath = './tsconfig.json', |
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
Started PATCH "/entities/91ba686a-81d0-46a6-a72f-0f8984ed4592/notes/0fdfc60b-509e-4535-aa1f-1f8ae5772432" for ::1 at 2016-04-20 04:16:38 -0300 | |
Processing by Entities::NotesController#update as HTML | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"FSfEqDe2HOQRi0m1kdgQmk7czbGqbbqyYtzV7GK9ssPrOadzEjkD+7p6cMvrM503ZqjA139qNbCC7srMAvbNIw==", "note"=>{"status_id"=>"3f6da4cf-5f2e-4ed5-aa2f-01260d08fd58"}, "commit"=>"Done", "entity_id"=>"91ba686a-81d0-46a6-a72f-0f8984ed4592", "id"=>"0fdfc60b-509e-4535-aa1f-1f8ae5772432"} | |
User 3ms MATCH (n:`User`) WHERE (n.uuid = {n_uuid}) RETURN n LIMIT {limit_1} | {:n_uuid=>"15181e01-c157-441b-b576-e1c518099cf8", :limit_1=>1} | |
Entity 3ms MATCH (n:`Entity`) WHERE (n.uuid = {n_uuid}) RETURN n ORDER BY n.uuid LIMIT {limit_1} | {:n_uuid=>"91ba686a-81d0-46a6-a72f-0f8984ed4592", :limit_1=>1} | |
Note 3ms MATCH (n:`Note`) WHERE (n.uuid = {n_uuid}) RETURN n ORDER BY n.uuid LIMIT {limit_1} | {:n_uuid=>"0fdfc60b-509e-4535-aa1f-1f8ae5772432", :limit_1=>1} | |
Note#status 3ms MATCH note WHERE (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
'use strict'; | |
angular.module("providersApp", ["providersApp.services", "providersApp.filters", "providersApp.controllers", "ngResource", "ngRoute", "domstorage"]) | |
.config(["$routeProvider", "$httpProvider", function($routeProvider, $httpProvider) { | |
$routeProvider.when("/", { | |
templateUrl: "/angular/views/providers/index.angular.html", | |
controller: 'ProvidersCntl' | |
}); | |
$routeProvider.when("/details/:slug", { | |
templateUrl: "/angular/views/providers/details.angular.html", |
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
<div ng-app="providersApp"> | |
<ng-view></ng-view> | |
</div> |
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
<div class="row"> | |
<div class="col-md-12"> | |
<h2> | |
Proveedores | |
<div class="pull-right"> | |
<input type="text" ng-model="search" class="form-control" placeholder="Filtrar proveedores..."> | |
</div> | |
</h2> | |
<div class="row"> | |
<div class="col-md-4"> |
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
include vim | |
vim::bundle { 'wincent/Command-T': } | |
vim::bundle { 'scrooloose/nerdtree': } | |
vim::bundle { 'kchmck/vim-coffee-script': } | |
vim::bundle { 'altercation/vim-colors-solarized': } | |
vim::bundle { 'tpope/vim-markdown': } | |
vim::bundle { 'tpope/vim-rails': } | |
vim::bundle { 'tpope/vim-vividchalk': } | |
vim::bundle { 'tpope/vim-surround': } | |
vim::bundle { 'tpope/vim-commentary': } |
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
(43.9ms) SELECT COALESCE(SUM(CASE submitted_premiums.kind WHEN 'Target' THEN | |
submitted_premiums.premium * (policy_advisors.commission_percent / 100) ELSE 0.00 END), 0.00) AS target_premium, COALESCE(SUM(CASE submitted_premiums.kind WHEN 'Single' THEN | |
submitted_premiums.premium * (policy_advisors.commission_percent / 100) ELSE 0.00 END), 0.00) AS single_premium, COALESCE(SUM(CASE submitted_premiums.kind WHEN 'Excess' THEN | |
submitted_premiums.premium * (policy_advisors.commission_percent / 100) ELSE 0.00 END), 0.00) AS excess_premium, advisors.id AS entity_id, TRIM(CASE WHEN people.first_name <> ' ' AND people.first_name IS NOT NULL THEN people.first_name || ' ' ELSE '' END::Text || | |
CASE WHEN people.middle_name <> ' ' AND people.middle_name IS NOT NULL THEN people.middle_name || ' ' ELSE '' END::Text || | |
CASE WHEN people.last_name <> ' ' AND people.last_name IS NOT NULL THEN people.last_name || ' ' ELSE '' END::Text || | |
CASE WHEN people.suffix <> ' ' AND people.suffix IS NOT NULL THEN people.suffix |
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
# And with a simple call like AdvisorSubmittedPremiumTotal.first, these are the results (1s or 1.2s) : | |
>> AdvisorSubmittedPremiumTotal.first | |
AdvisorSubmittedPremiumTotal Load (1206.7ms) SELECT "advisor_submitted_premium_totals".* FROM "advisor_submitted_premium_totals" LIMIT 1 | |
=> #<AdvisorSubmittedPremiumTotal policy_status_id: 1, advisor_id: 46, date: "2008-05-13", kind: "Initial", premium: #<BigDecimal:106f4b1c0,'0.145237E4',18(36)>> | |
# If I filter the date with the current year I have better performance but is slowest than the original sql inside reports (avg 0.5s): | |
>> AdvisorSubmittedPremiumTotal.where("date>=? and date<=?",date_start, date_end).first | |
AdvisorSubmittedPremiumTotal Load (456.5ms) SELECT "advisor_submitted_premium_totals".* FROM "advisor_submitted_premium_totals" WHERE (date>='2012-01-01' and date<='2012-12-31') LIMIT 1 | |
=> #<AdvisorSubmittedPremiumTotal policy_status_id: 1, advisor_id: 54, date: "2012-01-04", kind: "Initial", premium: #<BigDecimal:108c77cd0,'0.975E3',9(36)>> | |
>> Advisor |
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
SELECT | |
-- COALESCE(SUM(CASE submitted_premiums.kind WHEN 'Target' THEN submitted_premiums.premium * (policy_advisors.commission_percent / 100) ELSE 0.00 END), 0.00) AS target_premium, | |
-- COALESCE(SUM(CASE submitted_premiums.kind WHEN 'Single' THEN submitted_premiums.premium * (policy_advisors.commission_percent / 100) ELSE 0.00 END), 0.00) AS single_premium, | |
-- COALESCE(SUM(CASE submitted_premiums.kind WHEN 'Excess' THEN submitted_premiums.premium * (policy_advisors.commission_percent / 100) ELSE 0.00 END), 0.00) AS excess_premium, | |
COALESCE(SUM(CASE advisor_submitted_premium_totals.kind WHEN 'Target' THEN advisor_submitted_premium_totals.premium ELSE 0.00 END), 0.00) AS target_premium, | |
COALESCE(SUM(CASE advisor_submitted_premium_totals.kind WHEN 'Single' THEN advisor_submitted_premium_totals.premium ELSE 0.00 END), 0.00) AS single_premium, | |
COALESCE(SUM(CASE advisor_submitted_premium_totals.kind WHEN 'Excess' THEN advisor_submitted_premium_totals.premium ELSE 0.00 END), 0.00) AS excess_premium, | |
advi |
NewerOlder