Skip to content

Instantly share code, notes, and snippets.

View rlunaro's full-sized avatar
馃挱
Relaxed

Raul Luna Rodr铆guez rlunaro

馃挱
Relaxed
View GitHub Profile

How to extract to text source files the content of an excel spreadsheet code

I have a pair of excels with some interesting code I want to keep track in git. Keeping the whole excel is the easiest way to do, but I wondered how store a copy of the source files in a separate folder in order to maintain an adequate control over the source files itself.

Below is an vbs script I have to export the code of all the excel files of a directory into another directory. You have to do two things:

  1. configure the excelDir and sourcesDir with the apropiate values for
@rlunaro
rlunaro / server-and-client-on-python.md
Created November 22, 2024 07:39
Server and client on python

Server and Client on python

Here is an example of a server program and a client program that communicate each other over the network.

The server, once the client has received a connection from the client, attends the request by spawning a dedicated thread.

It's a very simple scheme that can help to develop a more complex python use cases that communicate over the network.

@rlunaro
rlunaro / angular-forms-template-driven-approach.md
Last active July 30, 2024 17:11
Angular Forms: template driven approach

Angular forms: template driven approach

In the template driven approach you define the form behaviour and configuration in the template: validators, and so on.

You can find a more detailed tutorial at: https://angular.dev/guide/forms/template-driven-forms#

We will start with this simple example made in ionic (but you can do in html exactly the same):

@rlunaro
rlunaro / creation-of-a-minecraft-mod-server.md
Last active June 26, 2024 20:52
Creation of a Minecraft Mod Server

Steps

Things you will need

  • a computer with a running java installation
  • fair knowledge of linux and internet

Grab the necessary mod files

In my case, there is other person that recovers for me the mod files

@rlunaro
rlunaro / simple_log_parser.md
Created April 27, 2024 07:04
A simple log parser for apache log analysis

Simple log parser for apache

Sometimes it's useful to do it by yourself: examining the apache logs for searching certain patterns. In that ocassions, the most cumbersome thing is to start just parsing the log file. So this script comes in handy as an start thing to suit your needs and perform just the analysis you need.

So, given this log configuration:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
@rlunaro
rlunaro / programacion_modular_c.md
Last active April 18, 2024 18:19
B谩sico de programaci贸n modular en C

B谩sico de programaci贸n modular en C

Intro

Al repartir el c贸digo en varios ficheros fuente, conseguimos estructurar nuestra aplicaci贸n en "temas": socios por un lado, cursos por otro, por ejemplo. Eso permite que la colaboraci贸n entre varias personas sea m谩s f谩cil. Pero no s贸lo eso, facilita la mantenibilidad de la aplicaci贸n.

Y adem谩s as铆 es como trabajan los profesionales, por todos estos motivos.

@rlunaro
rlunaro / notes-on-reactive-forms.md
Last active November 16, 2022 16:20
Notes on Reactive Forms

Configure the application to support reactive forms

In the app.module.ts, in the imports section, declare the class ReactiveFormsModule:

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [

BrowserModule,

@rlunaro
rlunaro / notes-on-validators.md
Last active October 13, 2022 11:54
Notes on Angular Validators
@rlunaro
rlunaro / formatDateUtil
Created October 4, 2022 18:05
a function that return a useful string representation of a date (like "a week ago")
/**
* Given a Date object, returns a string representing
* a "useful" translation of that date.
*
* A useful representation is "two days ago" instead of
* "18/08/2022" or "In two hours" to represent that the
* event represented by this date will begin on two hours.
*
* valores que vamos a retornar:
@rlunaro
rlunaro / notes-on-observables.md
Last active October 3, 2022 06:41
Notes on Observables

Notes on Observables

Intro

The basic pattern of the observable or observer, and has two parts:

  • The observable itself, that is, the object hat emits changes to any observer that wants to listen to it
  • The observers, objecst who get called any time the observable emits a change

Simple example