lunes, 5 de diciembre de 2016

Little Pet Project Asp.Net Core

I´ve pushed a new little pet project with asp.net core
It has a little login and a CRUD with tasks. Remember that it´s a pet-project for testing this new tecnology.

Happy coding

viernes, 2 de diciembre de 2016

martes, 1 de noviembre de 2016

HttpRequestBuilder

Some times, I need to mock the controller request , for example for viewing the http headers or content-type. I was thinking the best way to solve this little problem. So I write a very small utility (it satisfies my needed), using builder pattern.

Of course I use tdd with monodevelop, nunit and Moq.

The code lives here

jueves, 27 de octubre de 2016

Nice and interesting video

I've discovered this video I think is just nice, due to the sound and the coordination between music and graphics.

jueves, 6 de octubre de 2016

Palying with BackgroundWorker class

In large web applications sometimes we need some async process. So I found the BackgroundWorker class

I've write a little example:




public class MainClass
{
 public static void Main (string[] args)
 {
  var process = new BackGroundProcess ();

  Console.WriteLine ("--start---");
  process.DoWork (new ProcessRequest{ Value = "1254879" });
  Console.WriteLine ("--end---");
  Console.ReadKey ();
 }
}

public class BackGroundProcess
{
 private readonly BackgroundWorker backGroundWorker;

 public BackGroundProcess ()
 {
  backGroundWorker = new BackgroundWorker ();
  backGroundWorker.WorkerSupportsCancellation = false;
 }

 public void DoWork(ProcessRequest request){
  backGroundWorker.DoWork += DoWork;
  backGroundWorker.RunWorkerAsync (request);
 }

 private void DoWork(object sender, 
  DoWorkEventArgs e)
 {   
  var param = e.Argument as ProcessRequest;
  Thread.Sleep (100);
  Console.WriteLine ("param: " + param.Value);
 }
}

public class ProcessRequest
{
 public string Value{ get; set;}
}
the output is:
--start---
--end---
param: 1254879

jueves, 15 de septiembre de 2016

Gestión del tiempo

Con el paso de los años, me voy dando más cuenta de que vale más el tiempo que el dinero. De que realmente lo que me gustaría es de poder disfrutar de más tiempo.

Me he encontrado este video que habla sobre cómo conseguir más tiempo con pequeñas y sencillas recetas. De la mano de Sergio Fernández

jueves, 16 de junio de 2016

My new PetProject: BugTracker


I've finished my new pet-project BugTracker.
With this little and unfinished asp.net mvc project.
I developed it with Monodevelop as IDE, xsp4 as a web server, some concepts of DDD and Hexagonal Architecture. mongodb as database.


sábado, 23 de abril de 2016

My new pet-project a tester for express routes

Some time ago I started a little pet-poject for learning node, express, ... I found an problem because I cannot test the routes of my express api.

There are solutions like frisbyjs but I needed only test my routes, not the hole application calling the rest api. So I've write a little library for it.

Here is the code it's a little baby ;-)

Some tests examples


the configuration of the server
var express = require('express');

var app = express();

app.put('/users', function(req, res){
    res.send('Users');
});

app.get('/users/:id', function(req, res){
    res.send('Users --> id');
});

app.delete('/users', function(req, res){
    res.send('Users --> id');
});

module.exports = app;
and the tests
var config = require('./expressRouteTest');
var server = require('./server');

config(server)
        .withVerb('put')
        .forUrl('/users');
        
config(server)
        .withVerb('get')
        .forUrl('/users/:id');
        
config(server)
        .withVerb('delete')
        .forUrl('/users');

miércoles, 16 de marzo de 2016

Playing with wallabyjs

Some time ago, I've dicovered wallabyjs. It is a test runner like ncrunch but for javascript.
I've done a little kata with Atom as an IDE

 It's a good product for tdd.

jueves, 14 de enero de 2016

Playing with express and mongodb in nodejs

Today I've finished a little toy.

It's a simple api rest of users, GET, POST, DELETE over http://localhost:8080/api/users The code lives here

I'm studing the ecosystem of node-javascript. I think that it's very interesting. But I need a debugger, because a little project is fine, but in a huge one, it becomes a horrible monster.

A new song in my life by Ludovico Einaudi.

Happy crafting :-)