Skip to content

Instantly share code, notes, and snippets.

View corlaez's full-sized avatar
🏠
WFH since January 2020

Armando Cordova corlaez

🏠
WFH since January 2020
View GitHub Profile
@corlaez
corlaez / Project1.cpp
Created June 16, 2025 20:14
comentado carrera c++
#include "pch.h"
#include <iostream>
#include <conio.h>
#include <Windows.h>
#include <ctime>
#include <vector>
using namespace System;
using namespace std;
@corlaez
corlaez / Project1.cpp
Created June 16, 2025 04:04
Carrera C++ con conteo de ganadas
#include "pch.h"
#include <iostream>
#include <conio.h>
#include <Windows.h>
#include <ctime>
#include <thread>
#include <vector>
#include <string>
using namespace System;
@corlaez
corlaez / Project1.cpp
Created June 15, 2025 23:22
Carrera C++ con musica
#include "pch.h"
#include <iostream>
#include <conio.h>
#include <Windows.h>
#include <ctime>
#include <thread>
#include <vector>
using namespace System;
using namespace std;
@corlaez
corlaez / Project1.cpp
Created June 15, 2025 23:02
Carrera C++ Single File
#include "pch.h"
#include <iostream>
#include <conio.h>
#include <Windows.h>
#include <ctime>
#include <thread>
#include <vector>
using namespace System;
using namespace std;
@corlaez
corlaez / Project1.cpp
Created June 15, 2025 22:48
Carrera C++
#include "pch.h"
#include <iostream>
#include <conio.h>
#include <Windows.h>
#include <ctime>
#include "myutils.h"
#include <thread>
using namespace System;
using namespace std;
@corlaez
corlaez / Cliente.java
Last active September 27, 2024 06:40
Codigo para persistir objetos en Java
package clases;
import java.io.Serializable;
public class Cliente implements Serializable {
private static final long serialVersionUID = 1_000_000_000_000_001L;
private Integer codigo;
private String nombre;
private String apellido;
@corlaez
corlaez / LICENSE
Last active February 20, 2024 18:04
html dsl htmx extensions
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@corlaez
corlaez / README.md
Last active December 24, 2023 00:30
Tiny Kotlin Static Server

This is a tiny kotlin server, useful for simple dev scenarios. Features and limitations:

  • Validation of arguments, no hiding of errors
  • No caching, will read file each time is served (ideal for development server)
  • No dependency or dep management (gradle, maven). Just a single kotlin file and bat scripts
  • Prints all routes that it configures
  • Explicit, it requires you to declare a list of the filesnames to serve
  • No nesting. It will only serve files in the same directory

startServerAfterCompile.bat takes longer to initialize because it first compiles serve.kt to serveKt.class. However, this is only necessary if you are making changes to serve.kt. Use startServer.bat to run the server without compiling (starts faster)

@corlaez
corlaez / checkboxFix.js
Last active June 10, 2023 08:44
htmx cookbook
// This is meant to be in a html head script tag
// checkboxes are very inconvenient in html and will serialize nothing when the checkbox is unchecked
// instead of using hx-vals and writting a bit of JSON each time you have a checkbox I decided to fix it globally:
window.onload = function() {
document.body.addEventListener('htmx:configRequest', function(evt) {
const isInput = evt.detail.elt.tagName == 'INPUT';
const isCheckbox = evt.detail.elt.type == 'checkbox';
const isNotChecked = evt.detail.elt.checked == false;
if(isInput && isCheckbox && isNotChecked) {
const name = evt.detail.elt.name;
@corlaez
corlaez / README.md
Last active June 6, 2023 03:12
Kotlin Webjars Locator Ktor Gradle

This is how I like to use webjars in kotlin.

build.gradle.kts dependencies:

dependencies {
    // webjars
    implementation("org.webjars:webjars-locator:0.46")
    implementation("org.webjars.npm:htmx.org:1.9.2")
}