Posts

Showing posts from 2017

NuGet scripting in VS 2017

Image
Spanish version / Versión en Español If any of you ever published a .NET project as a NuGet package and needed some custom scripting to run when the package was installed, this used to be possible using the install.ps1/uninstall.ps1 mechanism . However, support for this was dropped in Visual Studio 2017, which bundles NuGet 4.x. The Init.ps1 script is still supported, but it runs every time the solution is opened, which might not be appropiate for most use cases. Another problem with the new VS 2017 NuGet way of doing things is that the .nuspec file, which was used to define metadata and files to package, is now gone; metadata is now handled via the project's properties, in the new Packaging section: In turn, this information is saved in the .csproj project file: The problem with this is, how to define which files to package inside the resulting .nupkg file using only .csproj? There is an alternate approach to NuGet scripting which involves embedding MSBuild

Correr scripts en NuGet en VS 2017

Image
Versión en inglés / English version Si alguna vez publicaron un proyecto .NET como paquete NuGet y necesitaron ejecutar scripting personalizado al instalar el paquete, eso era posible antes usando el mecanismo install.ps1/uninstall.ps1 . Sin embargo, el soporte para esto fue retirado en Visual Studio 2017, el cual incluye NuGet 4.x. El script Init.ps1 sigue siendo soportado, pero el mismo es invocado cada vez que se abre la solución, lo cual puede no ser apropiado para la mayoría de los casos de uso. Otro problema con el nuevo manejo de NuGet en Visual Studio 2017 es que el archivo .nuspec, que se usaba para definir metadata del paquete y archivos extra a empaquetar, ya no está; la metadata en VS 2017 ahora se maneja a través de las propiedades del proyecto, en su nueva sección Packaging: Una vez ingresada en las propiedades del proyecto, esta información es almacenada en el archivo .csproj: El problema con este nuevo enfoque es, ¿cómo definir qué archivos empaqueta

Blog renewal and cleanup - New syntax highlighting

Spanish version / Versión en Español After switching to a more modern Blogger theme, I lost the syntax highlighting provided by Alex Gorbatchev's Syntax Highlighter , a project which is still alive and kicking but for some reason, doesn't play nice with Blogger's dynamic themes. Researching a bit, I stumbled upon Highlight JS , and I liked its simplicity and versatily. It lacks line numbers, but as the author explains , they are not a deal breaker and the code looks very nice. To install and use Highlight JS on Blogger, 3 simple steps are required: Go to Theme-Edit HTML and add links to Highlight JS' CSS and JS files inside <head>. For example, using CDNJS links for version 9.10: <link href='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/tomorrow-night.min.css' rel='stylesheet'/> <script src='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/highlight.min.js'/> I am using a c

Renovación y limpieza del blog - Nuevo coloreado de sintaxis

Versión en inglés / English version Al pasar a un tema de Blogger más moderno, perdí el coloreado de sintaxis provisto por el plugin Syntax Highlighter de Alex Gorbatchev , proyecto que sigue vivo al día de hoy pero por alguna razón que no logré dilucidar, no funciona con los nuevos temas dinámicos de Blogger. Investigando un poco, me topé con Highlight JS , y me gustó su simpleza y versatilidad. No tiene números de línea, pero como su creador explica , no son imprescindibles y realmente se ve mucho mejor. Para instalar Highlight JS en un blog de Blogger, se requieren 3 simples pasos: Ir a Tema-Editar HTML y agregar links al CSS y JS de HighlightJS dentro de <head>. Por ejemplo, usando los de CDNJS para la versión 9.10: <link href='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/tomorrow-night.min.css' rel='stylesheet'/> <script src='//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/highlight.min.js'/&

Cross-browser radio buttons and checkboxes using only CSS3

Spanish version / Versión en Español Each browser gives input elements the look and feel it desires, and it cannot be customized directly on every browser. For radio buttons and checkboxes, we can get around this issue by using only CSS3; no need to bring in extra dependencies. The trick is to use CSS to hide the native input element, and then add an empty span element as the first child of the input's label. Having a label associated to an input allows us to use the CSS3 + syntax to select those specific cases, and then we can select the child empty span to generate our custom look for the input element. So, if we wanted to customize our radio buttons, first, in HTML, we need to add the dummy span and use labels. For example: <!doctype html> <html> <div> <input type="radio" id="radio01" name="radio" /> <label for="radio01"><span></span>Radio Button 1</label> </div> <

Radio buttons y checkboxes iguales en todos los navegadores usando sólo CSS3

Versión en inglés / English version Cada navegador le da a los elementos de tipo input la apariencia que ellos definen, y dicha apariencia no puede ser personalizada de forma directa en todos los navegadores. Para radio buttons y checboxes, es posible resolver esta limitación usando sólo CSS3; no es necesario agregar dependencias a nuestro proyecto. El truco es usar CSS para esconder el elemento input nativo, y luego agregar un elemento span vacío como el primer hijo de la label del input. Tener una label asociada al input nos permite usar la sintaxis "+" de CSS3 para seleccionar esos casos particulares, y luego seleccionar el elemento span hijo del label para darle la apariencia personalizada que reemplazará al radio button. De esta manera, si deseáramos personalizar nuestros radio buttons, primero, en HTML, es preciso agregar labels y un elemento span vacío dentro de cada una. Por ejemplo: <!doctype html > <html> <div> <input type="

Serverless cloud computing: Introduction

Spanish version / Versión en Español Lately, there's been a buzz in the IT world about "Serverless" technologies. The term can be a bit misleading, because there is still a server machine doing server-side processing; the key difference is that when we talk about a "serverless" environment, the whole server infrastructure is managed by a third party. In a serverless environment, a developer only needs to provide his custom server-side code, and the platform will take care of running it when suitable. This takes the concept of cloud computing taking things off developer's hands a bit further. Let's recall those different kinds of cloud offerings and try to fit serverless there: IaaS : Infastructure as a Service. The cloud vendor offers an interface for the users to manage their infrastructure: servers, databases, and networks, using a special interface. That way, the user can allocate and consume computational resources using a pay-as-you-go mo

Serverless en la nube: Introducción

Versión en inglés / English version Últimamente, ha habido un revuelo en el mundo IT sobre tecnologías "Serverless". El término puede ser un poco confuso, porque sigue habiendo una computadora haciendo procesamiento del lado del servidor; la diferencia clave es que cuando hablamos de un entorno "serverless", toda la infraestructura del lado del servidor es manejada por terceros. En un entorno así, un desarrollador sólo necesita proveer su código a ejecutar del lado del servidor, y la plataforma de la nube se encargará de desplegarlo y ejecutarlo de manera conveniente y escalable. Esto lleva el concepto de cloud computing de delegar cosas a la nube un poco más allá. Recordemos los distintos tipos de servicios de cloud e intentemos meter a Serverless en esa lista: IaaS : Infastructure as a Service. El proveedor de cloud ofrece una interfaz para que sus usuarios manejen la infraestructura: servidores, bases de datos, redes y otros recursos. De esta manera, e