Skip to content

Instantly share code, notes, and snippets.

View ielcoro's full-sized avatar

Iñaki Elcoro ielcoro

  • Asemblia
  • Bilbao
View GitHub Profile
@ielcoro
ielcoro / ValidationBehavior.cs
Created October 31, 2019 15:17
FluentValidation integration with Mediatr sample
using MediatR;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
namespace FrameworkExtensions.MediatR.Validation
{
public class ValidationBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
where TResponse : IRequestResponse
{
@ielcoro
ielcoro / app.html
Last active February 15, 2018 18:05 — forked from jdanyow/app.html
Aurelia view engine hooks
<template>
<require from="./binding-functions"></require>
<h1 if.bind="!promise(myPromise).settled">
....
</h1>
<h1 if.bind="promise(myPromise).resolved">
It resolved!
</h1>
@ielcoro
ielcoro / app.html
Created June 14, 2017 13:23
Spreadsheet : default-functionalities
<template>
<require from="./spreadsheet.css"></require>
<div class ="e-main-panel">
<ej-spreadsheet id="Spreadsheet1" e-scroll-settings.bind = "scroll" e-import-settings.bind = "import"
e-export-settings.bind = "export" e-enable-pivot-table = "true" e-on-load-complete.trigger = "loadcomplete($event)"
e-on-open-failure.trigger = "openfailure($event)">
<ej-sheet e-range-settings.bind = "range">
</ej-sheet>
</ej-spreadsheet>
@ielcoro
ielcoro / parseCsv.cs
Created December 23, 2016 09:29
ParseCsv
using (var reader = new CsvReader(
new StreamReader(
await storageManager.Read(message.PackagePath, asset.Name)),
new CsvConfiguration()
{
Delimiter = "\t",
}))
{
while (reader.Read())
{
@ielcoro
ielcoro / helloController.js
Created May 24, 2016 14:07
Angular JS Events
var hello = angular.module('hello', []);
hello.controller('helloController', ['$rootScope', '$scope', function ($rootScope, $scope) {
$scope.isLoggedIn = false;
$rootScope.$on('userLogin', function (e) {
$scope.isLoggedIn = true;
});
$rootScope.$on('userLogout', function (e) {
var hello = angular.module('hello', []);
hello.controller('helloController', ['$rootScope', '$scope', function ($rootScope, $scope) {
$scope.isLoggedIn = false;
$rootScope.$on('userLogin', function (e) {
$scope.isLoggedIn = true;
});
$rootScope.$on('userLogout', function (e) {
@ielcoro
ielcoro / app.html
Last active May 18, 2016 18:38
Aurelia Events Sample
<template>
<require from="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></require>
<div class="page-host" style="margin-top:50px">
<router-view ></router-view>
</div>
</template>
@ielcoro
ielcoro / app.html
Created May 18, 2016 14:55
Aurelia Base Gist
<template>
<require from="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></require>
<div class="page-host" style="margin-top:50px">
<router-view ></router-view>
</div>
</template>
@ielcoro
ielcoro / alt-layout.html
Created May 18, 2016 14:22 — forked from anonymous/alt-layout.html
Aurelia router with layouts
<template>
<section class="au-animate">
<div class="well">
<content select="#navigation"></content>
</div>
<div>
<content select="#content"></content>
</div>
</section>
</template>
@ielcoro
ielcoro / bartolo.js
Last active August 29, 2015 14:25 — forked from dbonillaf/bartolo.js
var express = require('express');
var fs = require('fs');
var handlebars = require('handlebars');
var source = new Buffer(10);
// El objeto source no contiene nada
console.log(source.toString('utf-8'));
fs.readFile('home.html', function(error, content){